Closed Bug 1783492 Opened 2 years ago Closed 2 years ago

PDFs render in black-and-white when background color setting is changed

Categories

(Firefox :: PDF Viewer, defect)

Firefox 103
defect

Tracking

()

RESOLVED DUPLICATE of bug 1778068

People

(Reporter: yumpusamongus, Unassigned)

References

Details

Attachments

(3 files)

Attached image bad.png

Attach (recommended) or Link to PDF file here: https://new.mta.info/map/5256

Steps to reproduce the problem:

  1. In about:preferences, click "Manage Colors" and set the background color to anything other than white, such as light gray. (This sets browser.display.background_color in prefs.js.) Leave "Override the colors specified by the page", at the default setting of, "Never".

  2. Load any PDF that contains color, such as the MTA subway map.

What is the expected behavior?

Non-background PDF elements should be rendered in their intended colors. Forcing to two-color should only be done if the setting to override colors is enabled, or maybe if the specifed background color is substantially off white (say, WCAG contrast > 2.0).

What went wrong?

The PDF is thresholded to black-and-white, as in the attached bad.png.

Attached image good.png
Attached file Subway Map.pdf
See Also: → 1771813

This was driving me crazy until I figured out it was the colors setting today, which is a shame since the setting nice for plain HTML pages to fit in a dark theme by changing the default colors.

It seems to happen regardless of the override setting, the background colors are simply always overridden as long as either the text color isn't exactly #FFFFFF or the background #000000 (changing either one causes both the PDF text and background colors to change).
It doesn't seem to affect embedded images though, only colors from the PDF itself.

It actually seems to mix the foreground/background colors from the settings based on luminance or contrast, for example, with a green background and blue foreground, the background is green, text above is blue, if there's an overlay over it (like a rectangle with text in it) that is blue and any text in it is green. This seems to be intentional for some kind of high contrast mode or the always override setting, but it's just completely ignored.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: