question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@page size not working on firefox

See original GitHub issue

Hi. I’m using the pageStyle prop to set my document size and it’s working just fine on chrome, but I’m not getting the same result on firefox. What should I do to resize the pdf document on firefox?

This is how I’m using the pageStyle prop: pageStyle="@page { size: 1754px 1240px; margin: 0px } @media print {html, body {height: 99%}}"

Thanks.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
jonrhcommented, Aug 28, 2021

I ran into this issue as well trying to achieve landscape orientation. From what I can tell the CSS @page size descriptor is not supported in Firefox nor Safari:

Seems to be supported in Chrome and Edge among other browsers. So I do not think it is an issue caused by this library.

0reactions
jonrhcommented, Sep 2, 2021

Hi, @jonrh ! Have you found any workaround?

Unfortunately not. I found one potential hack, rotate the content by 90° in CSS: transform: rotate(-90deg);. It might work if you only need to print but the content will be all wrong if saved as a PDF.

Due to the inconsistent print behaviour of browsers my next steps will probably be to look into generating PDFs on the server side instead. Perhaps with LaTeX. Or something that gives more fine grained control.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pages won't print because the page size sent to the printer is a ...
My HP says the paper size sent to printer is 8.46 x 10.98 and it waits ... prints pages from Firefox just fine,...
Read more >
Unable to set paper size at all when using Firefox built-in PDF ...
If Firefox is not using the whole sheet of paper, this can be caused by Firefox having extracted the wrong paper size settings...
Read more >
Websites look wrong or appear differently than they should
This article explains how to fix problems with websites that display incorrectly in Firefox or don't work the way they should.
Read more >
Web pages won't fit into browser withour having to scroll < or >
To make things smaller, press Ctrl and - at the same time. To reset the size back to normal, press Ctrl and 0...
Read more >
Problem of changing paper size | Firefox Support Forum
When you change Paper Size in Firefox prefs, that size becomes to new default until it is changed again from within Firefox.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found