-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
units in page size don't work any more #2006
Comments
Hi, i've countered the same problem, so right now how can i create custom page size? thanks... |
@aditfurk one workaround is to use numeric units and convert the units to points. 1in = 72pt, and 2.54cm = 1in. So if you wanted to define a custom page size that is 10x14in, you can use For our use case though, this is not a viable solution because we have a large library of PDF templates that would have to be rewritten. I'm hoping for a PR to fix the issue in react-pdf instead. |
@bernharduw ahh okay, thanks for the answer |
Same here - page size specified in |
Looksl like 3.* has issues with page sizes and layout: diegomura/react-pdf#2006 renderer@2.3.0 and pdfkit@3.* is the best combination so far that is still an upgrade, but does not break the layout completely for some reason.
I believe "feat: variable dpi #1869" should be rolled back. Variable DPI should NOT be adjusting page size, but strictly image resolutions (the optional Resolution array %ALDImageResolution (see page 909 of PDF Reference 1.6). The changes made in #1869 weren't properly tested before being merged. It broke how a pdf is supposed to be structured. Ideally: |
any updates on this? |
Describe the bug
Variable dpi support in #1869 removed support for page sizes with units such as mm. The units should be converted to points before dividing by dpi.
To reproduce
These pages should be the same size, but the first one has invalid dimensions:
Here's the react-pdf REPL snippet.
Expected behavior
mm values in page sizes should work as in @react-pdf/renderer@2.x and @react-pdf/layout@3.1.x.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: