How to print to pdf in firefox

How do I Make Firefox Print a Background-Color Style? Feed for how to print to pdf in firefox ‘How do I Make Firefox Print a Background-Color Style?

35a7 7 0 1 1 1. 9 2 2 2h16a2 2 0 0 0 2-2v-4. 44A2 2 0 0 0 15. 68A1 1 0 0 1 5.

12a1 1 0 0 1 . M9 1a8 8 0 1 0 0 16A8 8 0 0 0 9 1zm. 69a4 4 0 0 0-. 29 0 0 1 1.

34 0 0 0 . 8 0 0 0 2. 07A8 8 0 0 0 8. 8 0 0 1 0-3. 83a8 8 0 0 0 0 7. 3A8 8 0 0 0 1. 77 0 0 1 4.

It looks ok in the browser, but when I go to print it in Firefox it comes out as black text on a white background. I imagine this is some sort of ink-saving feature, but is there any way around it? For now I have just removed the checkmark from Daniel A. There is an answer below that mentions that which should now be selected as the correct answer. Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.

There is nothing you can do in your CSS. Is there a way with javascript to detect if this setting is on or off? I found a solution, it’s a bit hacky, but with CSS pseudo elements you can create backgrounds using fat borders. Borders are printed even when “printing backgrounds” is off, just make them really thick! One note, Firefox sets all white font colors to black, so when you create a fake black background, Firefox still makes the text black, rendering the text invisible. I experimented with this and that’s the only unit that worked.

At least worked on Google Chrome 42. There is a simple solution for this. May not work on all browsers, but fixes FF text colors. Thank you for the fix. I like this CSS-only solution since it doesn’t need me to alter the DOM.

This is how I made it to work in my case by adding the below two lines to the particular div. This is a new feature in Firefox, and this is now the correct answer. I’d rather add a separate stylesheet for printing the page. Typically, you would want to remove things like navigation menus, breadcrumbs, ads, and maybe do some small changes in margins, paddings, borders and fonts compared to the on-screen stylesheet.

Even thinking about forcing the user to fill a whole page with black ink with white text seems silly to me. To add a separate print stylesheet, add another stylesheet to the head of your page. I only wanted a small area. That might just be, but keep in mind it’s the exact same mechanism that controls it.

Should the browser detect the surface area in the website, check it against desired DPI settings somewhere for print and THEN decide wheather or not to apply the BG-color? Not the answer you’re looking for? How to flush output of Python print? CSS to PDF with PHP? How to make div not larger than its contents?

How do I give text or an image a transparent background using CSS? How can I make the cursor a hand when a user hovers over a list item? How to print to stderr in Python? Regulate 5V to 5V with LM1117? Why do so many people apply for a PhD even when chances of getting a job are slim? Why is the German GEZ a fee and not a tax?