package camlpdf

  1. Overview
  2. Docs
Read, write and modify PDF files

Install

Dune Dependency

Authors

Maintainers

Sources

v2.7.1.tar.gz
md5=5ec4c14006769e68be97a3ed70d46bc7
sha512=2480a282a6ce09444ed14a3f41561375ecf7e3c57f7559a48ad9791d9f824e59820bfd39aa36910ff6bdc9b160cef76ab90dbbfe628c836c3f5c5081dfd5e452

doc/camlpdf/Pdfcrypt/index.html

Module Pdfcrypt

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 Stdlib.ref

If this is set, various debug is produced on standard output. On startup, is set to false

type permission =
  1. | NoEdit
  2. | NoPrint
  3. | NoCopy
  4. | NoAnnot
  5. | NoForms
  6. | NoExtract
  7. | NoAssemble
  8. | 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?

val recrypt_pdf : ?renumber:bool -> Pdf.t -> string -> Pdf.t

recrypt_pdf decrypted_and_modified re-encrypts a PDF document which was decrypted using the user password and owner password from the original encrypted file and the same permissions and encryption parameters.

val encrypt_pdf_40bit : string -> string -> permission list -> Pdf.t -> Pdf.t

Encrypt a PDF documnent, using 40 bit encryption, with given user and owner passwords.

val encrypt_pdf_128bit : string -> string -> permission list -> Pdf.t -> Pdf.t

Ditto for 128 bit encryption

val encrypt_pdf_AES : bool -> string -> string -> permission list -> Pdf.t -> Pdf.t

Encrypt a file using the AESV2 Crypt filter

val encrypt_pdf_AES256 : bool -> string -> string -> permission list -> Pdf.t -> Pdf.t

Encrypt a file using the AESV3 Crypt filter

val encrypt_pdf_AES256ISO : bool -> string -> string -> permission list -> Pdf.t -> Pdf.t

Encrypt a file using the AESV4 (ISO) Crypt filter

OCaml

Innovation. Community. Security.