PDF-A validation
Check that a PDF file follows the PDF/A-1b rules and get the list of errors. Typical uses: check documents before long-term archiving.
pdf validate_pdfapdf validate_pdfa

pdf validate_pdfa <file>


Description

    Validate a PDF file. Returns {valid, flavour (the rules used), claimed_flavour (from its XMP), error_count, errors: [{code, message, page, count}], note}

Parameters

    file:   The path of the PDF - String - required
admin
pdf validate_pdfa "tmp/a1b.pdf"
mentdb
{"valid": true, "flavour": "PDF/A-1b", "claimed_flavour": "PDF/A-1b", "error_count": 0, "errors": []}
an ordinary PDF
admin
invoice to_pdf "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5}]}" "tmp/doc_invoice.pdf"; pdf validate_pdfa "tmp/doc_invoice.pdf" "{\"max_errors\": 3}"
mentdb
{"valid": false, "flavour": "PDF/A-1b", "claimed_flavour": null, "error_count": 4, "errors": [{"code": "2.4.3", "message": "Invalid Color space, /DeviceGray default for operator \"Tj\" can't be used without Color Profile", "page": 1, "count": 13}, {"code": "2.4.3", "message": "Invalid Color space, DestOutputProfile is missing", "page": 1, "count": 4}, {"code": "2.4.3", "message": "Invalid Color space, The operator \"f\" can't be used without Color Profile", "page": 1, "count": 3}]}
a Factur-X declares PDF/A-3: not decided
admin
invoice to_pdf "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5}]}" "tmp/doc_invoice_fx.pdf" "{\"facturx\": true}"; pdf validate_pdfa "tmp/doc_invoice_fx.pdf" "{\"max_errors\": 2}"
mentdb
{"valid": null, "flavour": "PDF/A-1b", "claimed_flavour": "PDF/A-3b", "note": "the file declares PDF/A-3b and this validator only knows PDF/A-1: its conformity is not decided. The errors are those against PDF/A-1b.", "error_count": 3, "errors": [{"code": "1.4.7", "message": "Trailer Syntax error, EmbeddedFile entry is present in the Names dictionary", "page": null, "count": 1}, {"code": "1.2.9", "message": "Body Syntax error, EmbeddedFile entry is present in a FileSpecification dictionary", "page": null, "count": 1}]}

pdf validate_pdfa <file> <params>


Description

    Validate with parameters: max_bytes (50 MB, up to 512 MB), max_errors (50: the lines kept in errors; error_count stays complete)

Parameters

    file:   The path of the PDF - String - required
    params:   The parameters as JSON - String - required
admin
invoice to_pdf "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5}]}" "tmp/doc_invoice.pdf"; pdf validate_pdfa "tmp/doc_invoice.pdf" "{\"max_bytes\": 10}"
mentdb
ERROR: Sorry, an error appears (the file is larger than max_bytes (10 bytes)).