3

I tried the following way to change the PDF file background color in a Firefox browser (Firefox version 124.0, following an answer from here):

  1. Enter setting with about:config
  2. set pdfjs.forcePageColors to true
  3. set pdfjs.pageColorsBackground to a hex value color e.g., #FBF0D9

The issue is that the image color in the pdf is changed to black and white. Does any one know how to set the pdf background color to a specific hex value in Firefox (background color only)? I can do it in Acrobat Reader, and it only change the PDF background color and does not change its image color.

I also tried to use filter following this. I use this to find the filter setting. Then the color of the whole pdf is filtered, almost unreadable.

There is a Add-on for Firefox doqment and it can change the background color only. So it seems there is some way to do it. I am not sure if there is some setting currently in Firefox to do it.

nlite
  • 71

1 Answers1

0

Binary "Desktop PDF Readers" like Acrobat, Okular, SumatraPDF and others of that ilk, have the ability to set some PDF colour ranges for accessibility.

Same PDF file shown at exactly the same time, from a random selection of alternate viewer settings. The idea is to let user chose their ideal eyesight contrast between a back and front color endpoint. Acrobat and a rare one or two others provide a third background setting.

enter image description here

The issues arise when there are images, as generally the color range can ONLY be full RGB or 100% opposite. If you tip the light backround to dark, the images naturally flip from blue to red and vise versa. Editors like X-change (top right) and Acrobat DC (top left) do not work that way but alter their transparent background color to suit.

enter image description here

Firefox uses RGB images for rendering the whole page (as an image not the real PDF in its cache), thus the reversal of background color range will affect the foreground image contents.

enter image description here

In edited question and comments a Firefox replacement add-in PDF viewer was mentioned "Doqment", to enhance the Mozilla add-in that Firefox is bundled with. This works fairly well by altering the PDF.js (Update: PDF.js to version 4.0) background canvas colours, similar to how other desktop readers may do it.

enter image description here

If using MS Edge and still have the ability to switch to I.E Mode then an installed Acrobat Reader DC will still kick-in and use its desktop settings whatever those may be as its an external view.
enter image description here

K J
  • 1,248