Processing PDFs

Processing PDFs

This article describes the customization options available for processing PDF files in Hyperscience.

PDF Page Box

PDF Page Boxes are page dimensions defined in a PDF’s metadata that are primarily used for commercial printing purposes. However, with the PDF_PAGE_BOX “.env” file variable, you can also use these properties to control how your PDF files’ pages appear in the Hyperscience application.

The value of the PDF_PAGE_BOX variable determines which PDF Page Box type the system uses to display PDFs in the application. The possible values for this variable are listed below:

To learn more about PDF Page Boxes, see ActivePDF’s What are PDF Page Boxes.

Sometimes, images of PDF pages may appear as thumbnails if the PDF file defines incorrect page dimensions. To resolve this issue, you need to set PDF_PAGE_BOX to CropBox. Learn more about editing environment variables in Editing the ".env" file and running the application.

Mutool and Ghostscript

Hyperscience uses Mutool and Ghostscript to process PDF pages.

Order of tools

In v39.0.1-39.0.10, v38, and earlier versions, the system attempts to use Ghostscript before Mutool when processing PDFs, and this order cannot be edited.

In v39.0.11+, v39.1, and later versions, you can define the order in which these tools are used by editing the PDF_PAGINATION_LIBS “.env” file variable. By default, the system attempts to use Mutool before Ghostscript, and the variable is defined as follows:

Plain text

PDF_PAGINATION_LIBS=mutool,gs

If you have defined a value for PDF_PAGE_BOX, PDF_PAGINATION_LIBS will be ignored, and Ghostscript will be used as the default tool for PDF processing.