encryption

fun encryption(block: EncryptionScope.() -> Unit)

Password-protects the document. Calling this more than once replaces the previous configuration. See PdfEncryption for the per-platform support matrix (full on JVM/Desktop, partial on iOS, no-op on Android).

encryption {
ownerPassword = "owner"
userPassword = "user"
allowPrinting = false
}

fun encryption(encryption: PdfEncryption)

Password-protects the document with a pre-built PdfEncryption. Useful when the configuration is assembled elsewhere; equivalent to the encryption builder overload.