Losing styles while making PDF out of HTML


I have made an HTML page with inline and external styles. But while print as PDF, the page is losing it’s styles.

Please help.


You may need to set up a print style sheet (if your main style sheet is not targeted at print … e.g. media =“screen,projection,tv”). However, not all styles work in printing anyway, such as background images. We could give more help if you can provide a link.

I have linked another style sheet <link href=“css/cvr_home_print.css” rel=“stylesheet” type=“text/css” media=“print” /> and in the cvr_home_print.css if I define #wrapper {color: #0F0;} I don’t see the print preview with that color.

Can anyone please provide an example?

It’s works now, the script which I was using, was not working properly.

Glad to hear you found the solution. :slight_smile: