PDFDispatch Docs

PDF tools

Routes that work on PDFs you already have. Most of these steps can also run as part of a conversion, in the same request.

Routes

PageRouteAnswer
Merge/v1/pdf/mergeone PDF
Split/v1/pdf/splita ZIP of parts, or one PDF
PDF/A and PDF/UA/v1/pdf/pdfathe PDFs
Encrypt/v1/pdf/encryptthe PDFs
Watermark and stamp/v1/pdf/watermark, /stampthe PDFs
Rotate/v1/pdf/rotatethe PDFs
Flatten/v1/pdf/flattenthe PDFs
Compress/v1/pdf/optimizethe PDFs
Metadata/v1/pdf/metadata/read, /writeJSON, or the PDFs
Bookmarks/v1/pdf/bookmarks/read, /writeJSON, or the PDFs
Attachments/v1/pdf/attachmentsthe PDFs
Factur-X/v1/pdf/factur-xthe PDFs

All are POST with the PDFs as file parts. “The PDFs” means one PDF for one file sent, and a ZIP for several, each file keeping its name. Every successful request counts as one PDF on your plan, however many files it handles.

Options on conversion routes

The HTML, URL, Markdown and Office routes, and merge and split, also take these fields. They work on the PDF that was just made, so a finished, archived, protected document is still one request (and one PDF on your plan):

FieldTypeDefaultWhat it does
splitMode, splitSpan, splitUnifystring, string, boolean–Split the result. See Split.
watermarkSource, watermarkExpression, watermarkPages, watermarkOptionsstrings–Draw a watermark behind the content. See Watermark and stamp.
stampSource, stampExpression, stampPages, stampOptionsstrings–Draw a stamp over the content. See Watermark and stamp.
rotateAngle, rotatePagesinteger, string–Turn pages by 90, 180 or 270 degrees. See Rotate.
optimizeImages, imageQualityboolean, integerfalse, 80Re-compress the images to make the file smaller. See Compress.
pdfa, pdfuastring, boolean–Make a PDF/A or PDF/UA file. See PDF/A and PDF/UA.
metadataJSON object–Title, author and other document properties. See Metadata.
embeds, embedsMetadatafiles, JSON object–Attach files to the PDF. See Attachments.
facturxXml, facturxConformanceLevel, ...file, strings–Make an e-invoice. See Factur-X.
userPassword, ownerPassword, allow...strings, booleans–Protect the PDF with a password and limit what readers may do. See Encrypt.

Merge, split and the Office route also take flatten=true.

They run in a fixed order: split, watermark, stamp, rotate, flatten, compress images, PDF/A or PDF/UA, metadata, attachments, Factur-X, and encryption last. Two rules follow from the standards:

  • PDF/A cannot be encrypted. pdfa together with userPassword is refused with 400.
  • Only PDF/A-3 may carry attachments. embeds with PDF/A-1b or PDF/A-2b is refused with 400.