Skip to content

CLI

Info

Check out the dedicated page for install instructions.


Validate one PDF (by default against the profile declared in its XMP metadata):

page document.pdf
Result  : Conformant
Profile : PDF/A-1b
Time    : 0.005s

Summary output is the default. Use page document.pdf --format summary to select it explicitly. Run page --help for all options or page --version for the installed version.

If the document does not declare a profile, page exits with an explicit error. Use --profile to select a profile instead:

page document.pdf --profile ua1
Result  : Non-conformant
Profile : PDF/UA-1
Time    : 0.005s

Supported profile values are 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, and ua1.


Add --format details to emit each failure's rule ID, message, category, and known object locations. Page numbers are one-based and identify pages, page-owned annotations and content streams, and used resources and their dependencies. Shared objects can list several pages; document-wide objects and objects without an established page association have no page numbers. The labels before the colons are bold in an interactive terminal, and a blank line separates each rule:

page document.pdf --profile ua1 --format details
Result  : Non-conformant
Rules   : 1 failed rule / 104 total
Profile : PDF/UA-1
Time    : 0.017s

[ISO 14289-1:2014:7.18.1:2] Conformance: annotation 0 on page 1 has neither a non-empty /Contents entry nor a non-empty /Alt entry in its enclosing structure element
  Location: object 41 0 R (page 1)

Findings with multiple locations show the total number of distinct objects and up to three locations. Their description comes from the first finding for that rule:

[ISO 14289-1:2014:7.18.1:2] Conformance: annotation 0 on page 4 has neither a non-empty /Contents entry nor a non-empty /Alt entry in its enclosing structure element
  Locations: 488 objects
  Location: object 11 0 R (page 4)
  Location: object 12 0 R (page 4)
  Location: object 13 0 R (page 4)
  … 485 more locations (use --locations all)

Add --locations all to include every location in detailed terminal or file output. JSON always includes every known location:

page document.pdf --profile ua1 --format details --locations all
page document.pdf --profile ua1 --format details --locations all --output report.txt


Or use --format json to emit the details as JSON. Each failure includes its rule ID, message, category, and locations. Each location contains object_number, generation, and page_numbers; empty lists indicate that the corresponding location is unavailable. Locations refer to all findings for the rule, while the message retains the first description:

page document.pdf --profile ua1 --format json
{
  "source": "document.pdf",
  "profile": "ua1",
  "is_compliant": false,
  "rules": {
    "total": 104,
    "passed": 103,
    "failed": 1
  },
  "failures": [
    {
      "rule_id": "ISO 14289-1:2014:7.18.1:2",
      "message": "annotation 0 on page 1 has neither a non-empty /Contents entry nor a non-empty /Alt entry in its enclosing structure element",
      "category": "conformance",
      "locations": [{"object_number": 41, "generation": 0, "page_numbers": [1]}]
    }
  ]
}


Write the report to a file with --output. A .json extension selects JSON automatically; use --format details for a detailed text report:

page document.pdf --output report.json
page document.pdf --format details --output report.txt
page document.pdf --format summary --output summary.txt

Explicit --format details rejects a .json output path, and explicit --format json rejects a .txt output path. --format summary overrides .json inference. Other extensions, including no extension, are allowed. File output is uncolored and leaves stdout empty.

Exit codes

Code Meaning
0 Validation completed with no failed checks, or --help / --version was requested.
1 Operational failure, including I/O or safety-limit errors, missing or invalid profile declarations, output errors, and invalid CLI arguments.
2 The PDF is non-compliant, or the PDF parser could not parse the document.

Safety limits

The CLI exposes every SafetyLimits bound. Defaults are suitable for most documents and can be overridden per invocation:

page document.pdf --max-table-span 256 --max-table-grid-cells 250000
Option Default Purpose
--max-input-size 256 MiB Maximum input file size.
--max-decoded-stream-size 32 MiB Maximum decoded size of one stream.
--max-total-decoded-content-size 256 MiB Maximum combined decoded content and retained font-stream data.
--max-form-invocations 10,000 Maximum Form XObject expansions across one document.
--max-object-count 1,000,000 Maximum number of parsed indirect objects.
--max-reference-depth 256 Maximum reference-chain depth.
--max-xref-revisions 1,024 Maximum number of incremental-update revisions read from the cross-reference chain.
--max-table-span 1,024 Maximum number of rows or columns covered by one table cell.
--max-table-grid-rows 1,024 Maximum number of rows represented in an inspected table grid.
--max-table-grid-columns 1,024 Maximum number of columns represented in an inspected table grid.
--max-table-grid-cells 1,000,000 Maximum number of cells represented in an inspected table grid.
--max-unicode-cmap-mappings 1,000,000 Maximum number of mappings expanded from one ToUnicode CMap.

For trusted files, disable all configurable limits with page document.pdf --disable-safety-limits. The flag conflicts with any explicitly supplied --max-* option. Validation may consume unrestricted memory and CPU; see the safety limits guide for details.

Colors

With --color auto (the default), page colors human-readable output only when writing to a terminal and NO_COLOR is unset. JSON and saved reports are uncolored.

page document.pdf --color never
page document.pdf --color always

Set NO_COLOR or pass --color never to disable automatic colors. --color always forces colors in terminal and redirected human-readable output, even when NO_COLOR is set.