Insert pages
Inserts the pages of another PDF.
POST/forms/pdf/insert
Form data
Options
Insert the pages of another PDF after a given page:
curl \
--request POST http://localhost:3000/forms/pdf/insert \
--form files=@report.pdf \
--form files=@annex.pdf \
--form source=annex.pdf \
--form at=1 \
-o report.pdf
at: 0 inserts before the first page, and sourcePages picks the pages of annex.pdf to insert. The stage reads annex.pdf, so Gotenberg doesn't process it as a PDF of its own.
In a list of stages
The stage also runs in a list on /forms/pdf/pipe, and on the PDFs a Chromium or LibreOffice conversion makes, in its stages field:
curl \
--request POST http://localhost:3000/forms/pdf/pipe \
--form files=@report.pdf \
--form files=@annex.pdf \
--form 'stages=[
{ "op": "insert", "source": "annex.pdf", "at": 1 }
]' \
-o report.pdf