Module Pdfcrypt

module Pdfcrypt: sig .. end
Decrypting PDF files


Note that encryption depends on fixed object and generation numbers: don't change these (for example by calling Pdf.remove_unreferenced on the PDF) before writing.

Encryption support is part of the Pdfwrite module, since files are encrypted when they're written.

val crypt_debug : bool Pervasives.ref
If this is set, various debug is produced on standard output. On startup, is set to false
type permission = 
| NoEdit
| NoPrint
| NoCopy
| NoAnnot
| NoForms
| NoExtract
| NoAssemble
| NoHqPrint
val decrypt_pdf : ?keyfromowner:string ->
string -> Pdf.t -> Pdf.t option * permission list
Decrypt a PDF document, given the user password, returning the permissions under which the document was encrypted.
val decrypt_pdf_owner : string -> Pdf.t -> Pdf.t option
Decrypt a PDF document, given the owner password.
val is_encrypted : Pdf.t -> bool
Is a PDF encrypted?