Querying for details about a PDF document

Community ForumCategory: PDF2IMGQuerying for details about a PDF document
Datalogics Staff asked 2 years ago

How do I look up the size of a page in PDF2IMG?

1 Answers
Datalogics Staff answered 2 years ago

PDF2IMG is not a query tool; the software is not designed to provide information about the PDF documents it converts to graphic image files. It is possible to determine the number of pages in a PDF input file by using the API call pdf2img_get_num_pages within PDF2IMG. But to access the size of a page in a PDF document, you would need to use the Adobe PDF Library.

The PDPageGetMediaBox() API in the Adobe PDF Library provides the media box for a page in a document. PDF2IMG uses the media box as one of the methods available for defining the region within a page when rasterizing that page to an output file (see the description of the regions in the section on the pdfregion command line statement). The media box is the natural size of the page itself, or the maximum printable area of that page. Therefore, when the Adobe PDF Library API provides the media box for a page in a PDF document, it is (usually) the size of the paper itself.

Get instant access to the latest PDF news, tips and tricks!

Do you want monthly updates on the latest document technology trends?

By submitting the form, you agree to receive marketing emails from Datalogics. You may unsubscribe at any time.