Skip to main content
All methods are static. They use the configured endpoint (and auth) from Chromiumly.configure(). Every method also accepts downloadFrom, webhook, and outputFilename/trace — see Request tracing.

convert(options)

Convert PDFs to PDF/A and/or PDF/UA. At least one of pdfa or pdfUA is required.

merge(options)

Merge multiple PDFs into one.
bookmarks sets a final bookmark list (or a filename-keyed map applied before merging, with page indexes offset automatically). autoIndexBookmarks instead auto-extracts and offsets each input’s existing bookmarks — the two are mutually exclusive strategies. See Merge PDFs.

split(options)

Split PDFs by page range or intervals.
options.flatten is nested here, unlike the top-level flatten field on Chromium/LibreOffice convert() — see the note in Split PDFs. Import the PdfEngineRotate type from chromiumly when typing rotate options.

rotate(options)

Rotate pages of one or more PDFs (dedicated Gotenberg rotate route).

watermark(options)

Apply a watermark to one or more PDFs (dedicated route). watermark.source and watermark.expression are required.

stamp(options)

Apply a stamp to one or more PDFs (dedicated route). stamp.source and stamp.expression are required.

flatten(files, webhook?, output?, downloadFrom?)

Flatten forms and annotations. Positional arguments, not an options object.

readMetadata(options)

Read metadata from PDFs. Unlike flatten/readBookmarks, this takes a single options object, not positional arguments.

writeMetadata(options)

Write metadata to PDFs.

readBookmarks(files, webhook?, output?, downloadFrom?)

Read bookmarks from PDFs. Positional arguments, not an options object.

writeBookmarks(options)

Write bookmarks to PDFs.

encrypt(options)

Encrypt PDFs with user and/or owner password (dedicated route). At least one of options.userPassword or options.ownerPassword is required; since Gotenberg 8.34.0, an owner-password-only request produces an owner-only PDF that opens without a password but still enforces permissions.
See Encrypt PDFs.

embed(options)

Attach files to existing PDFs (dedicated route).
See Embed files.

facturX(options)

Turn existing PDFs into Factur-X / ZUGFeRD e-invoices (dedicated route): embeds the CII invoice XML under the canonical factur-x.xml name and converts the PDF to PDF/A-3.
See Factur-X / ZUGFeRD.

generate(filename, buffer)

Convenience: write a buffer to __generated__/<filename> in the current working directory.
Creates __generated__ if it does not exist.