File: pdfwrite.mli

package info (click to toggle)
camlpdf 0.5-1
  • links: PTS, VCS
  • area: non-free
  • in suites: squeeze, wheezy
  • size: 1,516 kB
  • ctags: 2,689
  • sloc: ml: 18,229; ansic: 139; makefile: 139
file content (45 lines) | stat: -rw-r--r-- 1,901 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
(** Writing PDF Files *)

(** Encryption methods. The boolean for [AES128bit] indicates encryption of
metadata or lack thereof. *)
type encryption_method =
  | PDF40bit
  | PDF128bit
  | AES128bit of bool
  | AlreadyEncrypted (* Used as as flag to prevent garbage collect being done. *)

(** The type of an encryption with certain user permissions. *)
type encryption = 
  {encryption_method : encryption_method;
   owner_password : string;
   user_password : string;
   permissions : Pdfcrypt.permission list}

(** Write a PDF document to an [Io.output], optionally encrypting and/or
linearizing. May raise [Io.EndOfOutput]. *)
val pdf_to_output : bool -> encryption option -> Pdf.pdfdoc -> Pdfio.output -> unit

(** Similarly to an OCaml channel. If [mk_id] set, build a new /ID (don't use
[mk_id] on encrypted documents).*)
val pdf_to_channel : bool -> encryption option -> bool -> Pdf.pdfdoc -> out_channel -> unit

(** Similarly to a named file. If [mk_id] is set, the /ID entry in the document's
trailer dictionary is updated using the current date and time and the filename.
Don't use [mk_id] on encrypted documents. *)
val pdf_to_file_options : bool -> encryption option -> bool -> Pdf.pdfdoc -> string -> unit

(** Simple version. Equivalent to [pdf_to_file_options false None true] *)
val pdf_to_file : Pdf.pdfdoc -> string -> unit

(** Recrypting version. Does not alter existing documents. Two string arguments are userpw then filename. *)
val pdf_to_file_recrypting : Pdf.pdfdoc -> Pdf.pdfdoc -> string -> string -> unit

(** Calculate a string of a pdf object. Due to OCaml's modest limit
on string length, this should be used only when the length of the output is
known to be limited (for example for debug purposes). *)
val string_of_pdf : Pdf.pdfobject -> string

(**/**)
(* For dodgy internal module recursion use only *)
val pagetree_make_explicit : (Pdf.pdfdoc -> Pdf.pdfdoc) ref