Skip to main content
The PDF class wraps Gotenberg’s PDF routes to work on PDFs you already have. It does not create PDFs from HTML, URLs or documents; use the Chromium or LibreOffice routes for that, with their own stages.

Run several stages: pipe

PDF.pipe() runs a list of stages on the PDFs you send, in order:
It answers the PDF, or a ZIP when several files come out: several inputs without a merge, or a split.

Run one stage

Each stage also has its own method, which takes the stage’s options next to the request options:

Read PDFs

The read methods answer JSON, which Chromiumly parses and types: one entry per PDF, under its file name. They take files, archives, downloadFrom, an optional password for encrypted PDFs, and trace. They don’t take a webhook or an output filename.

info

Inputs

Every method takes files, and may leave it out when archives or downloadFrom bring the PDFs (see Files and downloads). Each entry is a PdfInput:
Gotenberg takes the PDFs in the alphanumeric order of their names, and stages (such as compose) and the read methods refer to them by name. Name them after the order you want:
Every method except the read methods also takes webhook (see Webhooks) and outputFilename and trace (see Request tracing).

Save a result

PDF.generate() writes a buffer to the __generated__ directory under the current working directory:
See Reference — PDF for every method’s signature.