PDFEngines.merge()/PDFEngines.split() support PDF encryption via userPassword and ownerPassword:
- userPassword — Required to open the PDF.
- ownerPassword — Grants full access (e.g. printing, copying). If only
userPasswordis set, the document can still be opened with that password.
HtmlConverter, MarkdownConverter, LibreOffice.convert(), PDFEngines.merge(), and PDFEngines.split().
Screenshot routes (
UrlScreenshot, HtmlScreenshot, MarkdownScreenshot)
produce an image, not a PDF, and don’t accept userPassword/ownerPassword
at all.allowPrinting, allowCopying, allowModifying, allowAnnotating, allowFillingForms, allowAssembling), each defaulting to true. See PDF permissions.
Encrypting existing PDFs
There’s also a dedicatedPDFEngines.encrypt() route for encrypting existing PDFs directly, without a conversion. Unlike the routes above, it requires at least one of userPassword or ownerPassword; since Gotenberg 8.34.0, an owner-password-only request produces an owner-only PDF that opens without a password but still enforces permissions.