Skip to main content

Module canvas

Module canvas 

Source
Expand description

The imperative painting surface. A Canvas accumulates pdfboss_core::content::Op values — the exact IR the reader parses — plus the fonts and images those operators reference. Nothing here serializes; finish hands the parts to document assembly.

Resource naming contract: the font first used gets resource name F1, the next distinct font F2, …; image handles map to Im1, Im2, … in add_image order; groups registered with group map to Gp1, Gp2, …; distinct /ExtGState entries pushed by the alpha/blend-mode setters map to Gs1, Gs2, …. Assembly builds the matching /Resources dictionary from CanvasParts.

Structs§

Canvas
An imperative painter producing content-stream operators.
CanvasParts
The accumulated output of a finished canvas.
GroupHandle
Handle to a sub-canvas registered with Canvas::group, painted with Canvas::draw_group.
ImageHandle
Handle to an image registered on a canvas.

Enums§

BlendMode
A separable blend mode (ISO 32000 §11.3.5, Table 136), set with Canvas::set_blend_mode.
LineCap
Line cap style (ISO 32000 §8.4.3.3).
LineJoin
Line join style (ISO 32000 §8.4.3.4).