File: pdfpages.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 (102 lines) | stat: -rw-r--r-- 2,786 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
(** Parsing PDF Graphics Streams *)

(** A flat representation of the PDF graphics stream operators. Where the operator
contains the asterisk character (not allowable in OCaml syntax), a prime is
substituted. *)
type operator =
  | Op_w of float
  | Op_J of int
  | Op_j of int
  | Op_M of float 
  | Op_d of float list * float
  | Op_ri of string
  | Op_i of int
  | Op_gs of string
  | Op_q
  | Op_Q
  | Op_cm of Transform.transform_matrix
  | Op_m of float * float
  | Op_l of float * float
  | Op_c of float * float * float * float * float * float
  | Op_v of float * float * float * float
  | Op_y of float * float * float * float
  | Op_h
  | Op_re of float * float * float * float
  | Op_S
  | Op_s
  | Op_f
  | Op_F
  | Op_f'
  | Op_B
  | Op_B'
  | Op_b
  | Op_b'
  | Op_n
  | Op_W
  | Op_W'
  | Op_BT
  | Op_ET
  | Op_Tc of float
  | Op_Tw of float
  | Op_Tz of float
  | Op_TL of float
  | Op_Tf of string * float
  | Op_Tr of int
  | Op_Ts of float
  | Op_Td of float * float
  | Op_TD of float * float
  | Op_Tm of Transform.transform_matrix
  | Op_T'
  | Op_Tj of string
  | Op_TJ of Pdf.pdfobject
  | Op_' of string
  | Op_'' of float * float * string
  | Op_d0 of float * float
  | Op_d1 of float * float * float * float * float * float
  | Op_CS of string
  | Op_cs of string
  | Op_SC of float list 
  | Op_sc of float list 
  | Op_SCN of float list
  | Op_scn of float list
  | Op_SCNName of string * float list
  | Op_scnName of string * float list
  | Op_G of float
  | Op_g of float
  | Op_RG of float * float * float
  | Op_rg of float * float * float
  | Op_K of float * float * float * float
  | Op_k of float * float * float * float
  | Op_sh of string
  | InlineImage of (Pdf.pdfobject * Utility.bytestream)
  | Op_Do of string
  | Op_MP of string
  | Op_DP of string * Pdf.pdfobject 
  | Op_BMC of string 
  | Op_BDC of string * Pdf.pdfobject 
  | Op_EMC 
  | Op_BX
  | Op_EX
  | Op_Unknown of string

(** Parse a single byte stream to an operator list given a document and resource
dictionary. *)
val parse_stream :
  Pdf.pdfdoc -> Pdf.pdfobject -> Utility.bytestream list -> operator list

(** Given a pdf document, resource dictionary and list of streams representing
the graphics content (PDF allows a single page's graphics content to be split
over several streams), return a list of operators. Should raise PDFError if bad
content. *)
val parse_operators :
  Pdf.pdfdoc -> Pdf.pdfobject -> Pdf.pdfobject list -> operator list

(** Flatten a list of operators to an uncompressed PDF stream. *)
val stream_of_ops : operator list -> Pdf.pdfobject

(** Make a string of a single operator (for debug purposes). *)
val string_of_op : operator -> string

(** Same, but of several operators (for debug purposes). *)
val string_of_ops : operator list -> string