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

Firefox adds a blank page on printing - even with single empty page

Open janvydra opened this issue 5 years ago • 9 comments

print2.txt

Hi, Firefox, Edge and Explorer add a blank page on print preview and printing. The initial view on load looks fine, but when I hit "print" extra page is added. Am I getting something wrong? Is there a way to deal with this?

janvydra avatar Nov 21 '18 16:11 janvydra

Hi, @janvydra Pls, forget everything about IE... By the way, Firefox and Edge seems OK in my environment.

Check this example: https://github.com/cognitom/paper-css/blob/master/examples/a4.html

You can check the same file from this URL directly: https://raw.githack.com/cognitom/paper-css/master/examples/a4.html

Open the URL above on Firefox and Edge. You may also need to check the orientation of papers and stuff.

cognitom avatar Nov 22 '18 04:11 cognitom

I have the exact same problem with Safari (last version). Even with your direct example.

jlannoy avatar Feb 15 '19 14:02 jlannoy

Same problem only on widnows+firefox using 'Adobe PDF' or 'PDF Pro Virtual Printer' as output. Run well on linux... Chome is ok on all platforms.

screwt avatar May 22 '19 10:05 screwt

I have same problem on safari (platform is Mac OS). I fixed it like this. I think this solution is temporary fix.

.paper__sheet
  @extend .sheet
  @media print
    width: 100% !important
    height: 100% !important

I think we don't need width, height in printing mode. スクリーンショット 2019-08-30 12 16 43

NerdyBoyCool avatar Aug 30 '19 11:08 NerdyBoyCool

I am experiencing the same thing, a blank page is added after every page in FireFox, but only when printing, not when viewing in browser. (on Windows platform)

It seems to work in Chrome.

FlyveHest avatar Sep 21 '19 14:09 FlyveHest

Chrome seemed to be fine, but was having issues in Safari. This is how I fixed it. It didn't seem to cause any regression in Chrome.

@media print {
   .sheet {
      /* firefox, safari extra page fix */
      width: 100% !important;
      height: 100% !important;
      page-break-after: auto !important;
   }
}

bompus avatar Oct 07 '19 20:10 bompus

Hi just found this issue in Chrome. How to fix?

amdev avatar Dec 09 '19 10:12 amdev

I have found that reducing the paper size by 0.4mm (from 296mm to 295.6mm) will fix the issue in Firefox (Linux). body.A4 .sheet { width: 210mm; height: 295.6mm }

@bompus fix also eliminates the extra pages but it also causes the content on the next sheet to flow over the unused space of the sheet before it.

Fujihita avatar Oct 25 '20 21:10 Fujihita

Try putting style="contain: size;" or style="contain: strict;" around the parent element

warmwhisky avatar Apr 24 '23 08:04 warmwhisky