PdfEncryption
Standard-security password protection applied to a document.
The owner password unlocks full access; the user password (which may be empty) unlocks the document under the permission flags below. When the user password is empty the document opens without a prompt but still enforces the permission flags.
Platform support:
JVM / Desktop (PdfBox) — full support. Encrypted with AES‑256, the permission flags mapped onto the PDF access-permission bits.
iOS (Core Graphics) — owner/user passwords plus printing and copying are honoured via
kCGPDFContext*keys. There is no Core Graphics flag for "allow modification", so allowModification is ignored on iOS.Android —
android.graphics.pdf.PdfDocumentexposes no encryption API, so requesting encryption on Android is a no-op (the document is produced unencrypted). Encrypt out-of-band if you target Android.
Constructors
Properties
whether text/graphics may be extracted (copy/paste, accessibility readers).
whether the document content may be modified. Ignored on iOS (no corresponding Core Graphics flag).
whether the document may be printed.
password granting full, unrestricted access. Must be non-empty for protection to be meaningful.
password required to open the document; empty (the default) means no open prompt while the permission flags still apply.