Skip to main content

PDFEngines.encrypt

Encrypts existing PDFs directly using Gotenberg’s encrypt route, without going through a conversion:
At least one of 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 same userPassword/ownerPassword and permission fields are also available directly on:
  • Chromium converters (UrlConverter, HtmlConverter, MarkdownConverter) convert()
  • LibreOffice.convert()
  • PDFEngines.merge() and PDFEngines.split()
See Encryption and PDF permissions for the full cross-cutting reference.