# Processing PDFs

- Published on Sep 17, 2024
- 2 minute(s) read

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:

- **_MediaBox_** — defines the physical page size of your document. It includes the crop marks, bleed box, trim box, and art box described below.
- **_BleedBox_** — (default) represents the region to which the page’s contents or elements should be extended. This region may include any extra bleed area needed to accommodate the physical limitations when output in a production environment.
- **_TrimBox_** — defines the intended dimensions. It determines the final size of the page when printed.
- **_ArtBox_** — the content area of the page (i.e., the area covered with graphics and text).
- **_CropBox_** — specifies the region to which the contents of the page should be cropped when displayed on screen.

To learn more about PDF Page Boxes, see ActivePDF’s [What are PDF Page Boxes](https://supportz.activepdf.com/hc/en-us/articles/360002401273-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](https://help.hyperscience.ai/deployment/docs/editing-the-env-file-and-running-the-application).

## Mutool and Ghostscript

Hyperscience uses Mutool and Ghostscript to process PDF pages.

- Mutool is a command line tool that allows you to perform various operations on PDF files. It’s used to compress the size of the PDF or convert the file to a PNG, JPEG, TIFF, or SVG.
- Ghostscript is a tool for working with PostScript and PDF files. It allows you to view, convert, or manipulate these document formats.

### 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

```plaintext
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.
