Skip to content

[Bug]: With dark theme, when pdfjs.forcePageColors is set to true, bright white flashes during page scroll (and other artifacts) #18680

@Gitoffthelawn

Description

@Gitoffthelawn

Attach (recommended) or Link to PDF file

https://cdn.fulltextarchive.com/wp-content/uploads/wp-advanced-pdf/1/The-Red-Badge-of-Couragex6045.pdf
https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf

Web browser and its version

Firefox 129.0.2

Operating system and its version

Linux

PDF.js version

4.4.140

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. In Firefox 129.0.2, set pdfjs.forcePageColors to true in about:config.
  2. Set the dark theme to be the default in Firefox.
  3. Open https://cdn.fulltextarchive.com/wp-content/uploads/wp-advanced-pdf/1/The-Red-Badge-of-Couragex6045.pdf
  4. Scroll through the pages.
  5. Notice that the pages flash bright while as the user scrolls (very bad on slower computers).
  6. Open https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf
  7. Notice the bright white (colour #fff) page borders, even if the user has set pdfjs.pageColorsForeground to a less bright colour.

What is the expected behavior?

No white flashing when scrolling.
No bright white page borders in dark theme.

What went wrong?

Bright white flashing when scrolling.
Bright white page borders in dark theme, even when text foreground colour set to a less bright colour.

Link to a viewer

No response

Additional context

I found the problem and came to fix it. The problem arises from the background-color of the .pdfViewer .page selector being set to rgb(255 255 255) in viewer.css. When I remove that line of code, these issues are fixed.

So I went to the master branch to remove that line from viewer.css and create a pull request to attach to this issue report. But I'm not seeing that line in viewer.css.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions