Resize existing pages?
See original GitHub issueCan pdf-lib
be used to open an existing PDF document and resize the width and/or height of some of its pages?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Scale or resize printed pages in Acrobat and Reader
Manually scale using percentages · Choose File > Print. · From the Page Scaling pop-up menu, select Tile All Pages to expose the...
Read more >Resizing Pages - PDF Editor PDF Studio User Guide
PDF Studio can resize a page to a specified dimension. This tool can be used to scale pages so that the content better...
Read more >InDesign Basics: How Do I Change the Size of a Page in My ...
The rule of thumb is: If your page is blank or has very little content, you can just resize using the options available...
Read more >How to Adjust/ Resize PDF Pages ( Simple & Quick) - YouTube
Resizing PDF Pages In Adobe Acrobat Pro DC.
Read more >How to Change PDF Page Size in Adobe Acrobat
Then, go to "Page Setup," select the appropriate size from the "Size" option. Finally, click on the "Print," so Adobe Acrobat resize page...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here is an update of this code for a more recent version of pdf-lib (v1.17.0). I hope it might help as it would have saved me some times. It’s made to convert a PDF to A4 or US Letter format, but you can easily change it to resize to any format. I use the scale method when the new ratio of the page is similar to the old one. When it’s not the case, I used setSize + scaleContent + translateContent. My code doesn’t deal with annotation and might fail for PDF with different boxes sizes (mediaBox, cropBox, trimBox, …)
Thanks! Managed to modify it to my liking.