I have a website which I want to print to PDF using Firefox.
I can see the website correctly on the screen, but printing it results in an empty white page.
By using the Firefox Inspector Tool, I have discovered that the problem resides in the webpage using CSS rules to declare elements hidden when printing, through the @media css at-rule.
It does something like:
@media print {
div.no-print,
div.no-print * {
display: hidden !important;
}
}
How can I print my page like it is showed on the screen?
The solution is to overwrite this CSS with our own:
Remember to re-define the display attribute for elements for which it should not be that, for example tables: