package cpdf

  1. Overview
  2. Docs
type element =
  1. | Text of char list
  2. | HGlue of float
  3. | VGlue of float
  4. | NewLine
  5. | NewPage
  6. | Font of string * Pdftext.font * float
  7. | BeginDest of Pdfdest.t
  8. | EndDest
  9. | BeginDocument
  10. | Tag of string * int
  11. | EndTag

Experimental typesetter for cpdf

type t = element list
val to_string : t -> string

Debug printing

val font_widths : string -> Pdftext.font -> float -> float array

Return the font width table for a given (id, font, fontsize) combination.

val width_of_string : float array -> char list -> float

Calculate the widths of a string given a font width table, and list of char codes

val typeset : process_struct_tree:bool -> float -> float -> float -> float -> Pdfpaper.t -> Pdf.t -> t -> Pdfpage.t list * (string * int) list list

typeset process_struct_tree lmargin rmargin tmargin bmargin papersize pdf contents builds a list of pages of typset content.

val add_artifacts : Pdfops.t list -> Pdfops.t list

Add artifact markers to any un-marked part of the content stream.

OCaml

Innovation. Community. Security.