File: cpdftype.mli

package info (click to toggle)
cpdf 2.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,140 kB
  • sloc: ml: 35,825; makefile: 66; sh: 49
file content (31 lines) | stat: -rw-r--r-- 1,046 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
(** Experimental typesetter for cpdf *)
type element =
  Text of char list
| HGlue of float
| VGlue of float
| NewLine
| NewPage
| Font of string * Pdftext.font * float
| BeginDest of Pdfdest.t * string option
| EndDest
| BeginDocument
| Tag of string * int
| EndTag

type t = element list

(** Debug printing *)
val to_string : t -> string

(** Return the font width table for a given (id, font, fontsize) combination. *)
val font_widths : string -> Pdftext.font -> float -> float array

(** Calculate the widths of a string given a font width table, and list of char codes *)
val width_of_string : float array -> char list -> float

(** [typeset process_struct_tree lmargin rmargin tmargin bmargin papersize pdf contents] builds a
    list of pages of typset content. *)
val typeset : process_struct_tree:bool -> float -> float -> float -> float -> Pdfpaper.t -> Pdf.t -> t -> Pdfpage.t list * (string * int) list list

(** Add artifact markers to any un-marked part of the content stream. *)
val add_artifacts : Pdfops.t list -> Pdfops.t list