paper-css icon indicating copy to clipboard operation
paper-css copied to clipboard

Page sizes off by one mm?

Open rkaravia opened this issue 7 years ago • 4 comments
trafficstars

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.

rkaravia avatar Nov 15 '18 06:11 rkaravia

Probably because of this:

https://github.com/cognitom/paper-css/blob/c69fbe2d687c328345774fb81b5e81d40ea7ad47/paper.css#L39

shasderias avatar Nov 16 '18 11:11 shasderias

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!

cognitom avatar Nov 16 '18 11:11 cognitom

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.

ShynRou avatar Dec 14 '18 15:12 ShynRou

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

rkaravia avatar Dec 14 '18 19:12 rkaravia