I'm trying to print a pdf report by first generating it as a normal website with php, html and css. The report is nearly complete, there's just one more thing I'm trying to fix: there is an unexplainable whitespace / margin when printing the page on Chrome, whilst printing it on Firefox (developer edition) works fine.
Here's the link to the page that gets printed: https://aquadynamica.be/verslagen/api/verslagen/stackprintexample.php?verslagId=44
Please try printing (CTRL + P) and scroll down a little.
Examples:
Page 4 on chrome (As you can see the margin is there on chrome.):
On page with emulate css mediatype print
As you can see there is a margin when printing on chrome, but it's not there on firefox...
I've already checked out the following article: Inexplicable empty space on print from Chrome
However, increasing the page size with a few milimeters doesn't help, nor adding it to the margin (as you can see when using devtools on the URL, I've tried that). I've also checked if I set both the width and height somewhere which could cause the ratio to be forced, hence causing margins, but that doesn't seem to be the case or I missed something.
I was thinking of a few possible solutions:
Find a way to be able to use devtools when emulating the print (I tried rendering > emulate css media type > print, but that doesn't show the site divided into pages, which is what I need to be able to debug the spacing as it's not there when emulating css, only on actually printing.)
I'm using this api to render the html page into a pdf document. Is there a known alternative that uses a headless firefox installation rather than chrome? (I'm running it on Heroku)
Thanks in advance for your assistance. I hope the description of my issue is clear. If not, please don't hesitate let me know and I'll happily edit my question.
Kind regards, Jonas