module Pdfgraphics: sig
.. end
Structured Graphics. This will (eventually) be a module allowing for the raising of a page's contents to a tree form, the manipulation of that tree and its writing back to the page, with no possible loss of fidelity.
It is only a little experiment at the moment...
type
fpoint = float * float
type
winding_rule =
type
segment =
A segment (a straight line or bezier curve)
type
hole =
Each segment list may be marked as a hole or not.
type
closure =
type
subpath = hole * closure * segment list
A subpath
is the pair of a hole and a list of segments.
type
path = winding_rule * subpath list
A path is made from a number of subpaths.
val string_of_path : path -> string
type
tiling =
type
function_shading = {
}
type
radial_shading = {
|
radialshading_coords : float * float * float * float * float * float ; |
|
radialshading_domain : float * float ; |
|
radialshading_function : Pdffun.t list ; |
|
radialshading_extend : bool * bool ; |
}
type
axial_shading = {
|
axialshading_coords : float * float * float * float ; |
|
axialshading_domain : float * float ; |
|
axialshading_function : Pdffun.t list ; |
|
axialshading_extend : bool * bool ; |
}
type
shading_kind =
type
shading = {
}
type
pattern =
| |
ColouredTilingPattern of tiling |
| |
UncolouredTilingPattern of tiling |
| |
ShadingPattern of shading |
type
colvals =
| |
Floats of float list |
| |
Named of (string * float list) |
| |
Pattern of pattern |
type
transparency_attributes = {
|
fill_transparency : float ; |
|
line_transparency : float ; |
}
type
path_attributes = {
}
type
text_attributes = {
}
type
textblock_attributes = {
}
type
textblock = text_attributes * Pdfops.t
type
image_attributes = {
}
type
softmask_subtype =
type
transparency_group = {
|
tr_group_colourspace : Pdf.pdfobject option ; |
|
isolated : bool ; |
|
knockout : bool ; |
|
tr_graphic : t ; |
}
type
softmask = {
}
type
fontname = string * Pdf.pdfobject
type
graphic_elt =
For now, just support for reading paths out. Eventually a tree-structure for
an op stream.
type
t = {
}
val bbox_of_graphic : t -> float * float * float * float
Bounding box xmin, xmax, ymin, yman of a graphic
val graphic_of_page : Pdf.t -> Pdfpage.t -> t
Make a graphic from operations.
val graphic_of_ops : Pdfops.t list -> t
Make a graphic from a simple string.
val page_of_graphic : Pdf.t -> float * float * float * float -> t -> Pdfpage.t
Flatten a graphic to a list of operations and replace the operations in a
page by them, returning the new page.
val string_of_graphic : t -> string
Debug string of a graphic
val ops_of_simple_graphic : t -> Pdfops.t list
Operations from a simple graphic (i.e no need for resources etc.)
val streams_of_simple_graphic : t -> Pdf.pdfobject list
Pdfdoc.content entry from a simple graphic (i.e no need for resources etc.)
val transform_graphic : Pdftransform.transform_matrix -> t -> t
Transform a graphic by a matrix.