Convert a PDF to PDF/A-3.
POST/pdf/to-pdfa
Convert a PDF to PDF/A-3b, the archival format that Factur-X/Zugferd invoices require. Every result is validated, so the endpoint only returns a file that is a valid PDF/A-3b. If it cannot produce one, it answers with status 422, says why, and costs no credits.
A PDF that already is a valid PDF/A-3 is returned as it is. Any other PDF is repaired: the colour profile and the PDF/A metadata are added, fonts that are not embedded are embedded, and JavaScript and other actions that PDF/A forbids, such as starting a program, are removed. Pages, form fields, structure tags, attachments and links to web pages are kept. A font that is not embedded in the input is replaced by a substitute font with the same character widths, so the text set in it may look slightly different. changes lists what was detected.
The text of every page is extracted before and after the conversion and compared. A PDF whose text would change, or whose text cannot be compared, is never returned.
A signed PDF is repaired by adding the repairs after the signed content, where that is possible. The signature then still verifies, but PDF viewers point out that the document was changed after it was signed (changed-after-signing in changes). A certified PDF, whose signature forbids any change, and a signed PDF that has to be rewritten are rejected unless force is set.
Set force to true to allow fixes that go further: fixes that may change how pages look beyond a substitute font, and converting a PDF although that removes or invalidates its signatures (signatures-removed in changes). Without it, a PDF that needs this is rejected with the reasons.
Not supported: encrypted or password-protected PDFs (decrypt them first with the Decrypt PDF endpoint, /pdf/decrypt) and XFA forms. Limits: 25 MB and 500 pages. To create a Factur-X/Zugferd invoice, pass the result to the endpoint that embeds a Factur-X/Zugferd XML into a PDF (/business/facturx/embed).
Request
Header Parameters
- application/json
Bodyrequired
The PDF URL.
The Base64-encoded PDF file. Can be specified instead of url.
The PDF/A standard to convert to. Currently only PDF/A-3b is available, which is also the default.
Possible values: [PDF/A-3b]
Whether fixes are allowed that may change how pages look beyond a substitute font, and whether a certified PDF or a signed PDF that has to be rewritten may be converted, which removes or invalidates its signatures. Default is false: a PDF that needs this is rejected with status 422 and the reasons.
Whether the PDF/A should be returned as a download URL (url) instead of Base64 (buffer). Default is false.
The PDF file name. Default is a random ID.
Responses
- 200
- 400
Success
- application/json
- Schema
- Example (auto)
Schema
- Array [
- ]
The Base64-encoded PDF/A file. Present unless getAsUrl is true.
The download URL of the PDF/A file, valid for 24 hours. Present if getAsUrl is true.
The file name of the result.
The number of pages.
The comparison of the text extracted from the input and the result, page by page: identical, or no-text if the PDF has no text, e.g. a scan. A PDF whose text differs or cannot be compared is not returned. It compares the text content, not the visual appearance.
Possible values: [identical, no-text]
changes object[]required
What the conversion removed or altered, as far as it can be detected. Empty if nothing of the kind happened.
One of fonts-substituted, javascript-removed, changed-after-signing, signatures-removed, forms-flattened, tags-removed.
What changed, as a sentence.
{
"buffer": "string",
"url": "string",
"fileName": "string",
"pages": 0,
"textCheck": "identical",
"changes": [
{
"code": "string",
"message": "string"
}
]
}
Bad Request
- application/json
- Schema
- Example (auto)
Schema
{
"status": 0,
"errorMessage": "string",
"code": "string"
}