camlpdf

Read, write and modify PDF files
Module Pdftext
type type3_glpyhs = {
fontbbox : float * float * float * float;
fontmatrix : Pdftransform.transform_matrix;
charprocs : (string * Pdf.pdfobject) list;
type3_resources : Pdf.pdfobject;
}
type simple_fonttype =
| Type1
| MMType1
| Type3 of type3_glpyhs
| Truetype
type fontmetrics = float array
type fontfile =
| FontFile of int
| FontFile2 of int
| FontFile3 of int
type fontdescriptor = {
ascent : float;
descent : float;
leading : float;
avgwidth : float;
maxwidth : float;
fontfile : fontfile option;
charset : string list option;
tounicode : ( int, string ) Hashtbl.t option;
}
type differences = (string * int) list
type encoding =
| ImplicitInFontFile
| StandardEncoding
| MacRomanEncoding
| WinAnsiEncoding
| MacExpertEncoding
| CustomEncoding of encoding * differences
| FillUndefinedWithStandard of encoding
type simple_font = {
fonttype : simple_fonttype;
basefont : string;
fontmetrics : fontmetrics option;
fontdescriptor : fontdescriptor option;
encoding : encoding;
}
type standard_font =
| TimesRoman
| TimesBold
| TimesItalic
| TimesBoldItalic
| Helvetica
| HelveticaBold
| HelveticaOblique
| HelveticaBoldOblique
| Courier
| CourierBold
| CourierOblique
| CourierBoldOblique
| Symbol
| ZapfDingbats
val string_of_standard_font : standard_font -> string
type cid_system_info = {
registry : string;
ordering : string;
supplement : int;
}
type composite_CIDfont = {
cid_system_info : cid_system_info;
cid_basefont : string;
cid_fontdescriptor : fontdescriptor;
cid_widths : (int * float) list;
cid_default_width : int;
}
type cmap_encoding =
| Predefined of string
| CMap of int
type font =
| StandardFont of standard_font * encoding
| SimpleFont of simple_font
| CIDKeyedFont of string * composite_CIDfont * cmap_encoding
val string_of_fonttype : simple_fonttype -> string
val string_of_encoding : encoding -> string
val string_of_simple_font : simple_font -> string
val string_of_font : font -> string
val read_type3_data : Pdf.t -> Pdf.pdfobject -> type3_glpyhs
val simple_fonttype_of_string : Pdf.t -> Pdf.pdfobject -> string -> simple_fonttype option
val read_basefont : Pdf.t -> Pdf.pdfobject -> string
val parse_charset : string -> string list
val read_fontdescriptor : Pdf.t -> Pdf.pdfobject -> fontdescriptor option
val read_metrics : Pdf.t -> Pdf.pdfobject -> float array option
val pairs_of_differences : Pdf.t -> Pdf.pdfobject -> (string * int) list
val standard_font_of_name : string -> standard_font option
val is_standard14font : Pdf.t -> Pdf.pdfobject -> bool
val is_embedded : Pdf.t -> Pdf.pdfobject -> bool
val is_symbolic : Pdf.t -> Pdf.pdfobject -> bool
val read_encoding : Pdf.t -> Pdf.pdfobject -> encoding
val read_simple_font : Pdf.t -> Pdf.pdfobject -> font
val read_standard14font : Pdf.t -> Pdf.pdfobject -> font
val is_simple_font : Pdf.t -> Pdf.pdfobject -> bool
val is_cidkeyed_font : Pdf.t -> Pdf.pdfobject -> bool
val read_cid_system_info : Pdf.t -> Pdf.pdfobject -> cid_system_info
val read_cid_widths : Pdf.pdfobject list -> (int * float) list
val read_descendant : Pdf.t -> Pdf.pdfobject -> composite_CIDfont
val read_cidkeyed_font : Pdf.t -> Pdf.pdfobject -> font
type section =
| BfChar of char list
| BfRange of char list
val getuntilend : char list -> char list -> char list * char list
val getuntilend_range : char list -> char list -> char list * char list
val get_section : char list -> (section * char list) option
val read_number : char list -> int * char list
val fail : unit -> 'a
val read_unicode : char list -> string * char list
val get_sections : char list -> section list
val pairs_of_section : section -> (int * string) list
val parse_tounicode : Pdf.t -> Pdf.pdfobject -> (int * string) list
val add_tounicode : Pdf.t -> font -> Pdf.pdfobject -> font
val find_tounicode : font -> ( int, string ) Hashtbl.t option
val read_font : Pdf.t -> Pdf.pdfobject -> font
val make_font : string -> Pdf.pdfobject
val write_encoding : Pdf.t -> encoding -> int
val write_font : Pdf.t -> font -> int
type text_extractor = {
convert : int -> string * int list;
font : font;
}
val utf16be_of_codepoint : int -> int list
val utf16be_of_codepoints : int list -> string
val fail2 : unit -> 'a
val codepoints_of_utf16be_inner : int list -> int list -> int list
val codepoints_of_utf16be : string -> int list
val add_encoding : ( differences -> unit ) -> encoding -> unit
val table_of_encoding : encoding -> ( int, string ) Hashtbl.t
val reverse_table_of_encoding : encoding -> ( string, int ) Hashtbl.t
val text_extractor_of_font_real : font -> text_extractor
val text_extractor_of_font : Pdf.t -> Pdf.pdfobject -> text_extractor
val is_identity_h : font -> bool
val glyphnames_and_codepoints_of_text : text_extractor -> string -> (string * int list) list
val codepoints_of_text : text_extractor -> string -> int list
val glyphnames_of_text : text_extractor -> string -> string list
val charcode_extractor_of_font_real : ?debug:bool -> font -> int -> int option
val charcode_extractor_of_font : ?debug:bool -> Pdf.t -> Pdf.pdfobject -> int -> int option
val is_unicode : string -> bool
val codepoint_of_pdfdocencoding_character : int -> int option
val get_utf8_chars : int -> int list
val utf8_of_codepoints : int list -> string
val codepoints_of_pdfdocstring : string -> int list
val utf8_of_pdfdocstring : string -> string
val codepoints_of_utf8 : string -> int list
val pdfdocencoding_of_codepoints : int list -> int list -> int list
val pdfdocstring_of_codepoints : int list -> string
val pdfdocstring_of_utf8 : string -> string
val simplify_utf16be : string -> string