Configuration
- Web browser and its version:
Pale Moon 32.4.0.1
- Operating system and its version:
Linux, 5.4.196-gentoo
- PDF.js version: 2.3.240
- Is a browser extension:
Yes
Steps to reproduce the problem
- Open any PDF with white page background.
- Try to change the background color of the page
What is the expected behavior?
I would like to change the background color of the page (the PDF page, where the text of the PDF appears) from the usual white to something more eye-friendly.
What went wrong?
No matter what I try it seems impossible to change the page background color.
I use the Stylem extension to set my own CSS for PDFs. This is a Pale Moon specific extension, but it works like the Stylish extension for Firefox and uses the same CSSs. While all the following works and changes the colors of the toolbar, sidebar, links etc.
@-moz-document regexp(".*.pdf")
{
/* Viewer body area: dark side margins */
#viewer.pdfViewer {
background-color: #EACCAF !important;
}
/* Viewer toolbar and elements */
#toolbarContainer > #toolbarViewer,
#toolbarContainer > #toolbarViewer input,
#toolbarContainer > #toolbarViewer select,
#toolbarContainer > #toolbarViewer option,
#toolbarContainer > #toolbarViewer span,
#secondaryToolbar,
#secondaryToolbar > #secondaryToolbarButtonContainer button {
color: #eee !important;
background-color: #4992A7 !important;
}
#toolbarContainer > #toolbarViewer button::before,
#toolbarContainer > #toolbarViewer a::before,
#toolbarContainer > #toolbarViewer span::after,
#secondaryToolbar > #secondaryToolbarButtonContainer button::before {
filter: invert(1) !important;
}
#toolbarContainer > #toolbarViewer button:hover,
#toolbarContainer > #toolbarViewer a:hover,
#sidebarContainer a:hover
{
background-color: #EDA870 !important;
}
#sidebarContent {
background-color: #4992A7 !important;
}
}
, none of the following has any effect:
.page, .canvasWrapper, .textLayer {
background-color: #EACCAF !important;
}
html body div#outerContainer.sidebarOpen div#mainContainer div#viewerContainer div#viewer.pdfViewer div.page div.textLayer {
background-color: #EACCAF !important;
}
#viewerContainer > #viewer > .page > .canvasWrapper > canvas {
background-color: #EACCAF !important;
}
It seems that pdf.js will use white, no matter what one sets for canvas, textLayer, or whatever CSS selector...

As you can see in the screenshot above, page background remains white.
Configuration
Pale Moon 32.4.0.1
Linux, 5.4.196-gentoo
Yes
Steps to reproduce the problem
What is the expected behavior?
I would like to change the background color of the page (the PDF page, where the text of the PDF appears) from the usual white to something more eye-friendly.
What went wrong?
No matter what I try it seems impossible to change the page background color.
I use the Stylem extension to set my own CSS for PDFs. This is a Pale Moon specific extension, but it works like the Stylish extension for Firefox and uses the same CSSs. While all the following works and changes the colors of the toolbar, sidebar, links etc.
, none of the following has any effect:
It seems that pdf.js will use white, no matter what one sets for canvas, textLayer, or whatever CSS selector...
As you can see in the screenshot above, page background remains white.