X
Tap here to go to the mobile version of the site.

Support Forum

not printing background images or colors (print.printer_Microsoft_Print_to_PDF.print_bgcolor;true)

Posted

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.

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.
Quote

Additional System Details

Installed Plug-ins

  • Shockwave Flash 32.0 r0

Application

  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

More Information

jscher2000
  • Top 10 Contributor
8758 solutions 71665 answers

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.)

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.)
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8758 solutions 71665 answers

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
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
Was this helpful to you?
Quote

Question owner

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.

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.
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8758 solutions 71665 answers

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.

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. * https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/67 * https://www.fxsitecompat.com/en-CA/versions/67/
Was this helpful to you?
Quote

Question owner

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.

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.
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8758 solutions 71665 answers

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.

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.
Was this helpful to you?
Quote

Question owner

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?

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?
Was this helpful to you?
Quote
jscher2000
  • Top 10 Contributor
8758 solutions 71665 answers

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.

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: [https://support.mozilla.org/questions/1262244 Window.print() issue]. I am not aware of any bug having been filed about this.
Was this helpful to you?
Quote
Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.