Skip to main content

PDFEngines.split

Splits PDFs using Gotenberg’s split route:
The options object holds the split configuration:
  • mode"pages" or "intervals"
  • span — Page range string (e.g. "1-2", "1,3,5")
  • unify — When mode is "pages", merge the split results into one PDF
  • flatten — Flatten form fields and annotations in the output — part of options on this route specifically (see the note below)
Gotenberg does not validate span when mode is "pages"; validation depends on the engine. See Gotenberg PDF Engines configuration.
PDFEngines.split() also accepts optional metadata, pdfa/pdfUA, userPassword/ownerPassword and the six permission booleans (see PDF permissions), and watermark, stamp, and rotate for PDF-engine post-processing on the split output. See Rotate PDFs. downloadFrom, webhook, outputFilename, and trace are also accepted — see Request tracing.

Split on Chromium and LibreOffice

Chromium converters and LibreOffice also support a split option on convert() so you can split the generated PDF in the same request:
See Chromium options and Reference — types for the ConvertSplit type.
flatten is not part of split on Chromium/LibreOffice convert() — it’s a separate top-level option there (see Flatten PDFs). It’s only nested inside options on the dedicated PDFEngines.split() route shown above.