Skip to main content
Skip table of contents

(v13) Inspecting PDF files

This page applies to Harlequin v13.1r0 and later; and to Harlequin Core but not Harlequin MultiRIP.

It is possible to inspect the contents of PDF files, before optionally proceeding to image the contents. There is no way to alter the PDF file but there is an opportunity to alter the imaging parameters.

A typical sequence of use is:

  1. Call pdfopen. This opens a PDF execution context on an open file and identifies an initial set of imaging parameters. (The execution context is a concept specific to the RIP, providing a simple way of identifying the opened file and associated PDF parameters.)
  2. Call getPDFtrailer. This provides basic file information and access to the file’s Catalog, and from there to the hierarchy of objects in the PDF file.
  3. Call getPDFobject, using the information obtained from getPDFtrailer . Repeat this call for all interesting objects until you have the information you require.
  4. Optionally, call pdfexecid. This images the file, potentially with alterations to the PDF parameters. You can make these alterations to PDF parameters and, possibly, prior changes to the pagedevice based on information obtained in the earlier steps of this sequence. For example, you might alter the PDF PageRange or choose a different kind of media.
  5. Call pdfclose. You must always do this to close the PDF execution context on the file. GGS suggests that you also need a closefile.

The PDF objects that your code reads are cached by the RIP, freeing your code from the need to maintain a separate cache for efficient repeated reads of the same objects.

It is possible to open a PDF execution context for each of several files.

The sequence just described assumes that your code starts by knowing that the job is PDF. It is also possible to discover while processing a job that it is PDF. If this is the case, the RIP can use the operator getPDFcontext to find the context identifier for subsequent use of getPDFtrailer and getPDFobject.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.