Validate a PDF
Checks PDFs against PDF/A, PDF/UA or Factur-X, or against PDF/A and PDF/UA together, and lists the violations.
JSON, one entry per PDF under its file name.
The route answers directly: it ignores Gotenberg-Output-Filename, and answers 400 to the webhook headers. An error answers a status and a message: see Errors.
curl \
--request POST http://localhost:3000/forms/pdf/validate \
--form files=@invoice.pdf \
--form profile=PDF/A-3b
{
"invoice.pdf": {
"profile": "PDF/A-3b",
"compliant": true,
"violations": []
}
}
profile takes the profiles remediate makes: the PDF/A levels, PDF/UA-1, PDF/UA-2 and Factur-X.
Validate against two profiles
A JSON array, or the field repeated, checks a PDF/A profile and a PDF/UA one together:
curl \
--request POST http://localhost:3000/forms/pdf/validate \
--form files=@archive.pdf \
--form 'profile=[
"PDF/A-2b",
"PDF/UA-1"
]'
{
"archive.pdf": {
"profile": [
"PDF/A-2b",
"PDF/UA-1"
],
"compliant": true,
"violations": []
}
}
compliant is true only when the PDF conforms to both, and each violation names the standard it breaks in specification. The pairs are the ones remediate makes: another answers 400.
Validate a Factur-X
curl \
--request POST http://localhost:3000/forms/pdf/validate \
--form files=@invoice.pdf \
--form profile=Factur-X
{
"invoice.pdf": {
"profile": "Factur-X",
"compliant": true,
"violations": []
}
}
The check covers the PDF/A-3b rules of the archival side and the Factur-X rules, the XML's included, and reports warnings for the softer ones of its Schematron, which don't make the invoice non-compliant.
Read the violations
Each violation names the rule a PDF breaks, and where:
{
"specification": "ISO_19005_2",
"clause": "6.1.7.1",
"testNumber": 2,
"description": "The stream keyword shall be followed either by a CARRIAGE RETURN (0Dh) and LINE FEED (0Ah) character sequence or by a single LINE FEED (0Ah) character. The endstream keyword shall be preceded by an EOL marker",
"context": "object 6: endstream keyword not immediately preceded by an EOL marker",
"severity": "fatal"
}
A fatal violation makes the PDF non-compliant. A warning, which only the Factur-X Schematron rules raise, doesn't.