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:
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 takesfiles, and may leave it out when archives or downloadFrom bring the PDFs (see Files and downloads). Each entry is a PdfInput:
compose) and the read methods refer to them by name. Name them after the order you want:
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: