Background and foreground colors #19275
Unanswered
samuelbradshaw
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! In #2071 (comment) it was mentioned that PDF.js supports setting a foreground and background color. However, I'm not sure where or how to set it when rendering a PDF page directly to a canvas. I'm basing my code on the examples here: https://mozilla.github.io/pdf.js/examples/
Is it possible to set a foreground and background color when rendering the PDF page?
I'd like to set the canvas background color to transparent, so I can put the text layer behind it, to make text selection and highlight colors look more natural. Secondarily, I'd like to support dark mode (dark background and light text).
Beta Was this translation helpful? Give feedback.
All reactions