not printing background images or colors (print.printer_Microsoft_Print_to_PDF.print_bgcolor;true)
I wrote an application that dynamically creates report and (using the printElement jQuery plugin) prints them to either a printer or to PDF.
$('.print-container').printElement({
pageTitle: $('div.edit-title').text(), overrideElementCSS:[ 'print_css', { href:'css/print.css', media:'print' } ] });
This has worked well for 5 years but, over the last weekend, even with the config set to print.print_bgcolor = true, no background colours or images are being printed any more. This happens with printing to a printer or to a PDF file.
All Replies (8)
Is your result using the plugin different from what Firefox shows in print preview, or the same?
If it's the same: Is this a page you control, or is it possible that there are new style rules affecting printing that were introduced recently which could be a factor (which the script is not overriding effectively)?
If it's different: I've never used that plugin. Do you know whether there is a demo page for it online that exhibits the same problem? (I'm assuming there's no practical way for forum volunteers to get hands on with your actual page.)
Also, just in case you haven't checked them all, there are individual settings for each printer:
(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful or accepting the risk.
(2) In the search box above the list, type or paste print_bg and pause while the list is filtered
Firefox will show a pair of preferences for each printer:
- print.printer_name.print_bgcolor
- print.printer_name.print_bgimages
Version 67 was automatically downloaded and installed when these problems first arose. I just intstalled version 66 and all the printing was back to normal with background images and colours as they should be.
There must be something more to it -- I get background colors when printing page in Firefox 67, even to the Microsoft PDF driver.
If you can think of a site that demonstrates the problem, that would be helpful. Perhaps it's a CSS change? These articles list headline items, but there may be lots of other changes.
I created exactly the same report in the same way and output the report to a PDF file in the same way with exactly the same CSS and jQuery script in both V66 and V67 of Firefox.
Thanks for the screenshots. It seems that none of your CSS is being applied in the newer PDF -- for example, sans-serif vs. serif font, font sizes, table borders, and "Job Titles" font color. So the problem looks more like style sheets not being applied (for some reason TBD) rather than the background color/image setting not working.
Is this problem going to be resolved, as all reports are having the same problem and the payroll manager is asking when it will be updated for her reports?
Sorry, I didn't have enough information to diagnose the problem at the time you wrote (without a public page to test).
Perhaps it is related to another thread from a couple weeks ago. Could you compare: Window.print() issue.
I am not aware of any bug having been filed about this.