PDFEngines.encrypt
Encrypts existing PDFs directly using Gotenberg’s encrypt route, without going through a conversion:userPassword or 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 the given permissions.
options also accepts the six PDF permission booleans (allowPrinting, allowCopying, allowModifying, allowAnnotating, allowFillingForms, allowAssembling), each defaulting to true.
downloadFrom, webhook, outputFilename, and trace are also accepted — see Request tracing.
Encryption on other routes
The sameuserPassword/ownerPassword and permission fields are also available directly on:
- Chromium converters (
UrlConverter,HtmlConverter,MarkdownConverter)convert() LibreOffice.convert()PDFEngines.merge()andPDFEngines.split()