JSON report – similar to XML report

The JSON report type allows easier access to details about the PDF and its processing. Parsing the structure might be simpler than with the existing XML report for several automation environments.

With pdfToolbox 15, an additional JSON report has been added. This gives you the option to choose between two different JSON reports:

  1. JSON report – based on JS object: Structure is similar to the app.doc.results array available in JavaScript Variables within callas products.
  2. JSON report – similar to XML report: Structure is similar to the XML report and lists resources that are referenced from the "result" section.

Advantages of the JSON v2 report

  • Access to additional result files such as SaveAsImage or reports
  • Improved overview of the process steps
  • Listing of only existing plate names (done by analysis); example: only Black for CMYK

The JSON v2 report is available:

  • After the normal Profile execution in Desktop in the "Create Report" functionality of the results dialog: JSON report – similar to XML report
  • In Process Plans as a report type in transitions after suitable Steps (Profile, Fixup, Check): JSONv2
  • On the CLI for Profile execution using --report=JSONV2 (all possible parameters for the JSON v2 report on the CLI are are documented here).

Components of the JSON v2 report

The JSON report contains four sections:

  1. doc: Information about the document. This information is independent of the executed profile.
  2. env: Information on various aspects of the environment such as platform, pdfToolbox version and license details.
  3. result:  Lists the executed process steps.
  4. settings: Reflects the options selected for the report generation.

The doc section

  1. info: Information about the PDF file e.g. creation date, PDFX version, producer.
  2. outputIntents: Contains a reference to the output intent information stored in "resources".
  3. pages: Contains the dimensions (relative and absolute) and the plates of all pages.
  4. plates: Lists all plates in the PDF document.
  5. resources: Contains all resource information for annotations, bookmarks, colorspaces, embedded files, fonts, form XObjects, images, layers, output intents, patterns and smooth shades.

Syntax of "resources"

  1. id: Each document resource has a unique ID name for identification.
  2. idRef: Referenced ID to a resource ID.

The result section

The result section lists all executed steps in the steps section. The following example shows the result of a preflight check that detects images with a resolution greater than 300 ppi:

1. checks: Lists all Checks which created a hit, whereas Checks without hits will not be listed.  

2. hits: If a Property used in the respective Check provides a trigger value, it will be listed.

3. idRef: The hit refers to a specific resource ID that is listed in the "doc" section under "resources". This makes it possible to identify which object on which page triggered the hit.

The settings section

This section shows the options selected for the report generation:

allchecks: Include Checks without hits. By default Checks are only listed when they generate at least one hit. 
allfixups: Include Fixups without changes. By default Fixups are only listed when they modify any objects. 
compact:  The JSON report will be written in a single line.
variables: All used Variables will be listed as well.