Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
janvydra opened this issue Nov 21, 2018 · 9 comments
Open
Labels

Comments

@janvydra
Copy link

janvydra commented Nov 21, 2018

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?

<style> @page { size: A4 } </style>
@cognitom
Copy link
Owner

cognitom commented Nov 22, 2018

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.

@jlannoy
Copy link

jlannoy commented Feb 15, 2019

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

@screwt
Copy link

screwt commented May 22, 2019

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.

@NerdyBoyCool
Copy link

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

@FlyveHest
Copy link

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.

@bompus
Copy link

bompus commented Oct 7, 2019

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;
   }
}

@amdev
Copy link

amdev commented Dec 9, 2019

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

@Fujihita
Copy link

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.

@warmwhisky
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants