Consistent page size when combining PDFs

,

Product: Apryse Server SDK (PHP)

Product Version: 11.7?

Please give a brief summary of your issue:
I am trying to combine several PDFs, but I want a document with consistent page size.

Please describe your issue and provide steps to reproduce it:
Using the example code from Merge, Copy, Delete, Rearrange PDF Pages - Sample Code | Apryse documentation , I have made a new PDF, but because the source PDFs are several different sizes, the new document also has everything in different page sizes, and I am not sure which objects and functions I should use to scale everything to a standard letter size page.

1 Like

Hello jday, There is a forum page with more information on what methods to use to scale the entire page. Please take a look here and let us know if it answers your question.

1 Like

Thanks! Is the number that you get from GetMediaBox()- > Width() a measurement in pixels? Since I’m not sure how PDFTron handles DPI yet, what Width() should I be aiming for in order to get a good quality print on A4?

1 Like

The Rect returned by Page.GetMediaBox() is expressed in PDF user space coordinates (PDF units), not pixels.

For more information about the PDF coordinate system and PDF units, see: What are PDF Units and Coordinates? : Apryse

An A3 page measures 11.69 × 16.54 inches. Since PDF coordinates use 72 units per inch, you can convert the page dimensions to PDF coordinates as follows:

Width  = 11.69 × 72 = 841.68
Height = 16.54 × 72 = 1,190.88

Let us know if you have any questions.

1 Like