Smart resolution to limit memory consumption

For many Fixups and Checks, pdfToolbox internally renders a PDF page or all pages in the PDF file.

There are two types:

  1. Fixups where the page is rendered and the result is used directly as page content (like bleed generation, convert page into image).
  2. Fixups and Checks that are also based on rendering, but only use the result for internal analysis (such as barcode detection, shape creation).

Here is a list of all Fixups and Checks that are based on internal rendering:

Fixups

  • Generate bleed at page edges
  • Generate bleed for irregular shapes
  • Convert page content into image
  • Create spot color plate based on ink amount
  • Set page geometry boxes (based on page content)
  • Create shape (from tracing page content)
  • Crop to visible based on rendered page

Check properties

  • Effective ink … properties
  • Find barcodes
  • Shape definition
  • Result file different from original (visual comparison)

Problem

The Checks and Fixups listed above require a rendering resolution to be set. Usually reasonable rendering resolutions (e.g. 300 ppi) result in unreasonably large memory consumption when used on large format files, because a lot of pixels have to be created.  This leads to long processing times and, if the results are used directly, to large result files.

Solution: Smart resolution

With pdfToolbox 15 all Fixups and Checks listed above have a new checkbox "Smart resolution for page dimensions > 75 cm". This checkbox provides an option to automatically adjust the resolution for large format files.

pdfToolbox's internal definition for large format files is that if a page has at least one page dimension that is larger than 75 cm, it is considered as a large format file. When the smart resolution is enabled, a resolution factor will be applied to each PDF page that has at least one page dimension that is greater than 75 cm.

Here is an example for smart resolution if 300 ppi is set as rendering resolution and the "Smart resolution for page dimensions > 75 cm" checkbox is enabled:

Page dimension of PDF page Resolution factor Smart resolution 
At least one page dimension is greater that 75 cm 0.75 225 ppi
At least one page dimension is greater that 150 cm
0.5 150 ppi
At least one page dimension is greater that 200 cm 0.25 75 ppi
At least one page dimension is greater that 400 cm
0.1 30 ppi

Use Case

If you always process PDF documents with similar page dimensions (e.g. only large-format files or only business cards), you don't need to use the smart resolution feature because you can set a rendering resolution in a Fixup or Check that works for all files. But if you have varying page dimensions, this feature is a really smart way to limit memory consumption.