package camlpdf

  1. Overview
  2. Docs
type fpoint = float * float
type winding_rule =
  1. | EvenOdd
  2. | NonZero
type segment =
  1. | Straight of fpoint * fpoint
  2. | Bezier of fpoint * fpoint * fpoint * fpoint
type hole =
  1. | Hole
  2. | Not_hole
type closure =
  1. | Closed
  2. | Open
type subpath = hole * closure * segment list
type path = winding_rule * subpath list
type tiling =
  1. | Tiling
type function_shading = {
  1. funshading_domain : float * float * float * float;
  2. funshading_matrix : Pdftransform.transform_matrix;
  3. funshading_function : Pdffun.t;
}
type radial_shading = {
  1. radialshading_coords : float * float * float * float * float * float;
  2. radialshading_domain : float * float;
  3. radialshading_function : Pdffun.t list;
  4. radialshading_extend : bool * bool;
}
type axial_shading = {
  1. axialshading_coords : float * float * float * float;
  2. axialshading_domain : float * float;
  3. axialshading_function : Pdffun.t list;
  4. axialshading_extend : bool * bool;
}
type shading_kind =
  1. | FunctionShading of function_shading
  2. | AxialShading of axial_shading
  3. | RadialShading of radial_shading
  4. | FreeFormGouraudShading
  5. | LatticeFormGouraudShading
  6. | CoonsPatchMesh
  7. | TensorProductPatchMesh
type shading = {
  1. shading_colourspace : Pdf.pdfobject;
  2. shading_background : Pdf.pdfobject option;
  3. shading_bbox : Pdf.pdfobject option;
  4. shading_antialias : bool;
  5. shading_matrix : Pdftransform.transform_matrix;
  6. shading_extgstate : Pdf.pdfobject;
  7. shading : shading_kind;
}
type pattern =
  1. | ColouredTilingPattern of tiling
  2. | UncolouredTilingPattern of tiling
  3. | ShadingPattern of shading
type colvals =
  1. | Floats of float list
  2. | Named of string * float list
  3. | Pattern of pattern
type objectclass =
  1. | PathObject
  2. | TextObject
  3. | ClippingPathObject
  4. | PageDescriptionLevel
  5. | ShadingObject
  6. | InlineImageObject
  7. | ExternalObject
val string_of_objectclass : objectclass -> string
type transparency_attributes = {
  1. fill_transparency : float;
  2. line_transparency : float;
}
type path_attributes = {
  1. path_transform : Pdftransform.transform_matrix;
  2. path_fill : (Pdfspace.t * colvals) option;
  3. path_line : (Pdfspace.t * colvals) option;
  4. path_linewidth : float;
  5. path_joinstyle : int;
  6. path_capstyle : int;
  7. path_dash : float list * float;
  8. path_mitrelimit : float;
  9. path_transparency : transparency_attributes;
  10. path_intent : string;
}
type text_attributes = {
  1. textmode : int;
}
type textblock_attributes = {
  1. textblock_transform : Pdftransform.transform_matrix;
}
type textblock = text_attributes * Pdfops.t
type softmask_subtype =
  1. | Alpha
  2. | Luminosity
type transparency_group = {
  1. tr_group_colourspace : Pdf.pdfobject option;
  2. isolated : bool;
  3. knockout : bool;
  4. tr_graphic : t;
}
and softmask = {
  1. softmask_subtype : softmask_subtype;
  2. transparency_group : transparency_group;
  3. softmask_bbox : float * float * float * float;
  4. backdrop : float list option;
  5. softmask_transfer : Pdffun.t option;
}
and image_attributes = {
  1. image_transform : Pdftransform.transform_matrix;
  2. image_transparency : float;
  3. image_softmask : softmask option;
}
and fontname = string * Pdf.pdfobject
and graphic_elt =
  1. | Path of path * path_attributes
  2. | Text of textblock list * textblock_attributes
  3. | MCPoint of string
  4. | MCPointProperties of string * Pdf.pdfobject
  5. | MCSection of string * graphic_elt list
  6. | MCSectionProperties of string * Pdf.pdfobject * graphic_elt list
  7. | Image of image_attributes * int
  8. | GraphicInlineImage of Pdf.pdfobject * Pdfio.bytes * Pdftransform.transform_matrix
  9. | Clip of path * graphic_elt list
  10. | Shading of path option * shading * Pdftransform.transform_matrix
and t = {
  1. elements : graphic_elt list;
  2. fonts : fontname list;
  3. resources : Pdf.pdfobject;
}
val bbox_of_segment : segment -> float * float * float * float
val bbox_of_path : ('a * ('b * 'c * segment list) list) -> float * float * float * float
val bbox_of_graphic_inner : (float * float * float * float) -> graphic_elt list -> float * float * float * float
val bbox_of_graphic : t -> float * float * float * float
val string_of_segment : segment -> string
val string_of_subpath : (hole * closure * segment list) -> string
val string_of_path : (winding_rule * (hole * closure * segment list) list) -> string
val string_of_textblock : ('a * Pdfops.t) -> string
val string_of_font : (string * Pdf.pdfobject) -> string
val string_of_colvals : colvals -> string
val string_of_attributes : path_attributes -> string
val string_of_graphic_elt : graphic_elt -> string
val string_of_graphic : t -> string
type state = {
  1. mutable objectclass : objectclass;
  2. mutable clip : path option;
  3. mutable intent : string;
  4. mutable fill : colvals;
  5. mutable linewidth : float;
  6. mutable line : colvals;
  7. mutable mitrelimit : float;
  8. mutable joinstyle : int;
  9. mutable capstyle : int;
  10. mutable colourspace_stroke : Pdfspace.t;
  11. mutable colourspace_nonstroke : Pdfspace.t;
  12. mutable dash : float list * float;
  13. mutable flatness : int;
  14. mutable transform : Pdftransform.transform_matrix;
  15. mutable extra_transform : Pdftransform.transform_matrix;
  16. mutable text_transform : Pdftransform.transform_matrix;
  17. mutable text_line_transform : Pdftransform.transform_matrix;
  18. mutable opacity_stroke : float;
  19. mutable opacity_nonstroke : float;
  20. mutable character_spacing : float;
  21. mutable word_spacing : float;
  22. mutable scale : float;
  23. mutable leading : float;
  24. mutable font_and_size : (string * float) option;
  25. mutable font_render : int;
  26. mutable font_rise : float;
  27. mutable blendmode : int;
  28. mutable softmask : softmask option;
  29. mutable in_xobject : int;
  30. mutable opdo_matrix : Pdftransform.transform_matrix;
}
val default_state : unit -> state
val state : state Pervasives.ref
val string_of_state : state -> string
val path_attributes_fill_and_stroke : unit -> path_attributes
val path_attributes_fill : unit -> path_attributes
val path_attributes_stroke : unit -> path_attributes
val textstate : unit -> text_attributes
val nonzero : winding_rule
val initial_colour : Pdf.t -> 'a -> Pdf.pdfobject -> colvals
type partial =
  1. | NoPartial
  2. | PartialText of textblock list
  3. | PartialPath of fpoint * fpoint * segment list * subpath list
val read_transparency_group : Pdf.t -> Pdf.pdfobject -> transparency_group * float * float * float * float
val read_soft_mask : Pdf.t -> Pdf.pdfobject -> softmask option
val update_graphics_state_from_dict : Pdf.t -> Pdf.pdfobject -> Pdf.pdfobject -> unit
val statestack : state list Pervasives.ref
val copystate : unit -> state
val push_statestack : unit -> unit
val pop_statestack : unit -> unit
val read_tiling_pattern : Pdf.pdfobject -> pattern
val read_function_shading : Pdf.t -> Pdf.pdfobject -> shading_kind
val read_radial_shading : Pdf.t -> Pdf.pdfobject -> shading_kind
val read_axial_shading : Pdf.t -> Pdf.pdfobject -> shading_kind
val read_shading_pattern : Pdf.t -> Pdf.pdfobject -> pattern
val read_pattern : Pdf.t -> Pdfpage.t -> string -> pattern
val process_op : Pdf.t -> Pdfpage.t -> (partial * graphic_elt list) -> Pdfops.t -> partial * graphic_elt list
val getuntil_matching_emc : int -> Pdfops.t list -> Pdfops.t list -> Pdfops.t list * Pdfops.t list
val getuntil_matching_Q : int -> Pdfops.t list -> Pdfops.t list -> Pdfops.t list * Pdfops.t list
val process_ops : Pdf.t -> Pdfpage.t -> (partial * graphic_elt list) -> Pdfops.t list -> partial * graphic_elt list
val fonts_of_page : Pdf.t -> Pdfpage.t -> fontname list
val read_form_xobject : Pdf.t -> Pdfpage.t -> Pdf.pdfobject -> graphic_elt list
val graphic_of_page : Pdf.t -> Pdfpage.t -> t
val graphic_of_ops : Pdfops.t list -> t
val int_of_shading_kind : shading_kind -> int
val entries_of_shading : Pdf.t -> shading -> (string * Pdf.pdfobject) list
val shading_object_of_shading : Pdf.t -> shading -> Pdf.pdfobject
val pattern_object_of_pattern : int -> Pdftransform.transform_matrix -> Pdf.t -> pattern -> Pdf.pdfobject
val ops_of_segs : segment list -> closure -> Pdfops.t list
val protect : Pdfops.t list -> Pdfops.t list
val attribute_ops_of_path : ('a * path_attributes) -> Pdfops.t list
val transform_ops_of_path : ('a * path_attributes) -> Pdfops.t list
val stroke_ops_of_path : ((winding_rule * 'a) * path_attributes) -> Pdfops.t
val path_ops_of_path : ('a * ('b * closure * segment list) list) -> Pdfops.t list
val ops_of_path : Pdf.t -> Pdfpage.t -> ((winding_rule * ('a * closure * segment list) list) * path_attributes) -> Pdfops.t list * Pdf.pdfobject
val ops_of_textstate : 'a -> 'b list
val ops_of_textpiece : ('a * 'b) -> 'b list
val ops_of_text : Pdftransform.transform_matrix -> ('a * Pdfops.t) list -> Pdfops.t list
val extreme_of_4 : ('a -> 'a -> int) -> 'a -> 'a -> 'a -> 'a -> 'a
val min_of_4 : float -> float -> float -> float -> float
val max_of_4 : float -> float -> float -> float -> float
val transform_bbox : Pdftransform.transform_matrix -> float -> float -> float -> float -> float * float * float * float
val pdfobject_of_transparency_group : (float * float * float * float) -> Pdf.t -> transparency_group -> int
val pdfobject_of_softmask : Pdf.t -> softmask -> int
val ops_of_image : Pdf.t -> Pdfpage.t -> (image_attributes * int) -> Pdfops.t list * Pdf.pdfobject
val ops_of_shading : Pdf.t -> Pdfpage.t -> path option -> shading -> Pdftransform.transform_matrix -> Pdfops.t list * Pdf.pdfobject
val ops_of_graphic_acc : Pdf.t -> Pdfpage.t -> Pdfops.t list list -> graphic_elt list -> Pdfops.t list * Pdfpage.t
val image_numbers_of_elts : int list -> graphic_elt list -> int list
val make_xobjects : Pdf.t -> graphic_elt list -> (string * Pdf.pdfobject) list
val make_resources : Pdf.t -> t -> Pdfpage.t -> Pdf.pdfobject
val page_of_graphic : Pdf.t -> (float * float * float * float) -> t -> Pdfpage.t
val ops_of_simple_graphic : t -> Pdfops.t list
val streams_of_simple_graphic : t -> Pdf.pdfobject list
val transform_segment : Pdftransform.transform_matrix -> segment -> segment
val transform_subpath : Pdftransform.transform_matrix -> ('a * 'b * segment list) -> 'a * 'b * segment list
val transform_path : Pdftransform.transform_matrix -> ('a * ('b * 'c * segment list) list) -> 'a * ('b * 'c * segment list) list
val transform_graphic : Pdftransform.transform_matrix -> t -> t
OCaml

Innovation. Community. Security.