`sig
type toget
type stream = Got of Pdfio.bytes | ToGet of Pdf.toget
type pdfobject =
Null
| Boolean of bool
| Integer of int
| Real of float
| String of string
| Name of string
| Array of Pdf.pdfobject list
| Dictionary of (string * Pdf.pdfobject) list
| Stream of (Pdf.pdfobject * Pdf.stream) Stdlib.ref
| Indirect of int
type objectdata =
Parsed of Pdf.pdfobject
| ParsedAlreadyDecrypted of Pdf.pdfobject
| ToParse
| ToParseFromObjectStream of (int, int list) Stdlib.Hashtbl.t * int *
int *
(int -> int list -> (int * (Pdf.objectdata Stdlib.ref * int)) list)
type pdfobjmap_key = int
type pdfobjmap =
(Pdf.pdfobjmap_key, Pdf.objectdata Stdlib.ref * int) Stdlib.Hashtbl.t
val pdfobjmap_empty : unit -> Pdf.pdfobjmap
val pdfobjmap_find :
Pdf.pdfobjmap_key -> Pdf.pdfobjmap -> Pdf.objectdata Stdlib.ref * int
type pdfobjects = {
mutable maxobjnum : int;
mutable parse : (Pdf.pdfobjmap_key -> Pdf.pdfobject) option;
mutable pdfobjects : Pdf.pdfobjmap;
mutable object_stream_ids : (int, int) Stdlib.Hashtbl.t;
}
type saved_encryption = {
from_get_encryption_values :
Pdfcryptprimitives.encryption * string * string * int32 * string *
string option * string option;
encrypt_metadata : bool;
perms : string;
}
type deferred_encryption = {
crypt_type : Pdfcryptprimitives.encryption;
file_encryption_key : string option;
obj : int;
gen : int;
key : int array;
keylength : int;
r : int;
}
type t = {
mutable major : int;
mutable minor : int;
mutable root : int;
mutable objects : Pdf.pdfobjects;
mutable trailerdict : Pdf.pdfobject;
mutable was_linearized : bool;
mutable saved_encryption : Pdf.saved_encryption option;
}
val empty : unit -> Pdf.t
exception PDFError of string
val input_pdferror : Pdfio.input -> string -> string
val getstream : Pdf.pdfobject -> unit
val getnum : Pdf.t -> Pdf.pdfobject -> float
val lookup_obj : Pdf.t -> int -> Pdf.pdfobject
val lookup_fail :
string -> Pdf.t -> string -> Pdf.pdfobject -> Pdf.pdfobject
val lookup_exception :
exn -> Pdf.t -> string -> Pdf.pdfobject -> Pdf.pdfobject
val lookup_direct :
Pdf.t -> string -> Pdf.pdfobject -> Pdf.pdfobject option
val lookup_immediate : string -> Pdf.pdfobject -> Pdf.pdfobject option
val lookup_chain :
Pdf.t -> Pdf.pdfobject -> string list -> Pdf.pdfobject option
val replace_chain : Pdf.t -> string list -> Pdf.pdfobject -> unit
val remove_chain : Pdf.t -> string list -> bool
val indirect_number : Pdf.t -> string -> Pdf.pdfobject -> int option
val lookup_direct_orelse :
Pdf.t -> string -> string -> Pdf.pdfobject -> Pdf.pdfobject option
val remove_dict_entry : Pdf.pdfobject -> string -> Pdf.pdfobject
val replace_dict_entry :
Pdf.pdfobject -> string -> Pdf.pdfobject -> Pdf.pdfobject
val add_dict_entry :
Pdf.pdfobject -> string -> Pdf.pdfobject -> Pdf.pdfobject
val direct : Pdf.t -> Pdf.pdfobject -> Pdf.pdfobject
val objcard : Pdf.t -> int
val removeobj : Pdf.t -> int -> unit
val addobj : Pdf.t -> Pdf.pdfobject -> int
val addobj_given_num : Pdf.t -> int * Pdf.pdfobject -> unit
val parse_rectangle :
Pdf.t -> Pdf.pdfobject -> float * float * float * float
val parse_matrix :
Pdf.t -> string -> Pdf.pdfobject -> Pdftransform.transform_matrix
val make_matrix : Pdftransform.transform_matrix -> Pdf.pdfobject
val renumber_pdfs : Pdf.t list -> Pdf.t list
val unique_key : string -> Pdf.pdfobject -> string
val objiter : (int -> Pdf.pdfobject -> unit) -> Pdf.t -> unit
val objiter_inorder : (int -> Pdf.pdfobject -> unit) -> Pdf.t -> unit
val objiter_gen : (int -> int -> Pdf.pdfobject -> unit) -> Pdf.t -> unit
val objselfmap : (Pdf.pdfobject -> Pdf.pdfobject) -> Pdf.t -> unit
val iter_stream : (Pdf.pdfobject -> unit) -> Pdf.t -> unit
val objselect : (Pdf.pdfobject -> bool) -> Pdf.t -> int list
val remove_unreferenced : Pdf.t -> unit
val is_whitespace : char -> bool
val is_not_whitespace : char -> bool
val is_delimiter : char -> bool
val page_reference_numbers : Pdf.t -> int list
val objnumbers : Pdf.t -> int list
val recurse_dict :
?preserve_order:bool ->
(Pdf.pdfobject -> Pdf.pdfobject) ->
(string * Pdf.pdfobject) list -> Pdf.pdfobject
val recurse_array :
(Pdf.pdfobject -> Pdf.pdfobject) -> Pdf.pdfobject list -> Pdf.pdfobject
val changes : Pdf.t -> (int, int) Stdlib.Hashtbl.t
val renumber :
?preserve_order:bool -> (int, int) Stdlib.Hashtbl.t -> Pdf.t -> Pdf.t
val renumber_object_parsed :
preserve_order:bool ->
Pdf.t -> (int, int) Stdlib.Hashtbl.t -> Pdf.pdfobject -> Pdf.pdfobject
val bigarray_of_stream : Pdf.pdfobject -> Pdfio.bytes
val objects_of_list :
(int -> Pdf.pdfobject) option ->
(int * (Pdf.objectdata Stdlib.ref * int)) list -> Pdf.pdfobjects
val objects_referenced :
string list ->
(string * Pdf.pdfobject) list -> Pdf.t -> Pdf.pdfobject -> int list
val generate_id : Pdf.t -> string -> (unit -> float) -> Pdf.pdfobject
val catalog_of_pdf : Pdf.t -> Pdf.pdfobject
val find_indirect : string -> Pdf.pdfobject -> int option
val nametree_lookup :
Pdf.t -> Pdf.pdfobject -> Pdf.pdfobject -> Pdf.pdfobject option
val contents_of_nametree :
Pdf.t -> Pdf.pdfobject -> (Pdf.pdfobject * Pdf.pdfobject) list
val deep_copy : Pdf.t -> Pdf.t
val change_id : Pdf.t -> string -> unit
type toget_crypt = NoChange | ToDecrypt of Pdf.deferred_encryption
val length_of_toget : Pdf.toget -> int
val input_of_toget : Pdf.toget -> Pdfio.input
val position_of_toget : Pdf.toget -> int
val toget :
?crypt:Pdf.toget_crypt -> Pdfio.input -> int -> int -> Pdf.toget
val string_of_pdf : (Pdf.pdfobject -> string) Stdlib.ref
val transform_rect :
Pdf.t -> Pdftransform.transform_matrix -> Pdf.pdfobject -> Pdf.pdfobject
val transform_quadpoints :
Pdf.t -> Pdftransform.transform_matrix -> Pdf.pdfobject -> Pdf.pdfobject
end`