paper-css
paper-css copied to clipboard
Page sizes off by one mm?
To me it looks like some page size definitions are off by one mm, e.g. the one for A3:
body.A3 .sheet { width: 297mm; height: 419mm }
body.A3.landscape .sheet { width: 420mm; height: 296mm }
A3 is defined as 297 x 420 mm, so I would expect it to be like this instead:
body.A3 .sheet { width: 297mm; height: 420mm }
body.A3.landscape .sheet { width: 420mm; height: 297mm }
But maybe there is a reason where some browsers have issues with the "correct" dimensions? Otherwise I would be happy to submit a PR to adapt them.
Probably because of this:
https://github.com/cognitom/paper-css/blob/c69fbe2d687c328345774fb81b5e81d40ea7ad47/paper.css#L39
Hi @rzoller,
As mentioned above, some browser inserts unwanted page-breaks at the end of the page, if we use the exact height like 297mm for A4. That's why. Thanks @shasderias!
For those who need a fullscreen background image: you add an absolute element that you set to fill the whole sheet and make sure to add bottom: -1.2mm;.
This will make sure the last millimeter is covered without overlapping to the next page.
Works for me on chromium based browsers.
Thanks everyone for your comments and suggestions, I also ended up working around the issue by adapting the padding by 1mm, see code here.
Results