stages to:
- the Chromium converters’
convert(), where they run on the printed PDF; LibreOffice.convert(), where they run on the exported PDFs;PDF.pipe(), where they run on the PDFs you send.
PDF class, such as PDF.merge() or PDF.sign().
op, with the option names Gotenberg documents. TypeScript checks each stage’s options.
Every stage
When several files come out, the answer is a ZIP: a
split into several parts, or render and the extracts, which return their files next to the PDF.
Files a stage needs
An option that names a file takes aStageFile: insert.source, stamp-image.image, stamp-pdf.source, attach.file, remediate.xml, sign.certificate and sign.key. Chromiumly uploads it with the request and puts its name in the stage.
{ name }, or give one of them another name.
compose is the exception: its placements[].source names one of the input PDFs, such as "report.pdf", rather than a file to upload.
Page selections
An option that takes pages, such asselect.pages, accepts a comma-separated list of parts:
odd,!1 keeps the odd pages after the first, and !last every page but the last. Without an inclusion, the selection starts from every page. Pages count from 1. A page past the end, or a selection that leaves no page, is refused with a 400.
Order rules
Gotenberg checks the order of the stages before it runs any, and refuses a list that breaks one of these rules with a 400 that names the rule:decryptcomes first, andrender,extract-attachmentsorextract-textlast.- A list has at most one
remediate, oneencrypt, onesignand onetimestamp. Oneremediatetakes a PDF/A profile and a PDF/UA one together. - After
remediate, onlyencrypt,optimize,sign,timestamp,render,extract-attachmentsandextract-textmay follow. - After
encrypt, onlyoptimize,render,extract-attachmentsandextract-textmay follow. - After
signortimestamp, onlysign,timestamp,render,extract-attachmentsandextract-textmay follow. encryptdoesn’t combine withsign,timestamp, or a PDF/A or Factur-Xremediate.decryptdoesn’t combine withsignortimestamp: sign the decrypted PDF in a request of its own.
select, delete, insert, merge, split, compose, encrypt, decrypt, flatten-form, redact, remediate, convert-colors, flatten-transparency and optimize. The others append an update and keep signatures.
See Reference — stages for every stage’s options.