DynaPDF Manual - Page 621

Previous Page 620   Index   Next Page 622

Function Reference
Page 621 of 839
Vector graphics are defined in page or form space depending on the object type in which the
graphics are stored. The mapping to user space is achieved by tranforming the coordinate pairs with
the current transformation matrix of the graphics state.
For example, if the TMoveTo callback function would be executed the application must transform
the provided coordinates to user space as follows:
// x and y are the parameters of the TMoveTo callback function
Transform(m_GState.Matrix, x, y);
Vector graphics in PDF are always defined as paths. A path is invisible until it will be filled or
stroked. PDF supports primitive path painting operators like bezier curves, lines, and rectangles
only. Circles and ellipses are always drawn with bezier curves in PDF.
Once a path was fully defined it is normally consumed by a TClosePath() or TClipPath() callback
function call. If this is not the case the path must be deleted when the page was fully processed.
When a path must be filled, stroked, or discarded the TClosePath callback function is executed. The
parameter Mode of the callback function specifies what must be done with the path:
// Fill the path (Winding)
// Fill the path (Even Odd)
// Close, fill and stroke the path (Winding)
// Close, fill and stroke the path (Even Odd)
// Fill and stroke the path (Winding)
fmFillStrokeEvOddNoClose // Fill and stroke the path (Even Odd)
// Stroke the path
// Close and stroke the path
// Discard the path
// Close the path with a straight line segment
A normal path is not part of the graphics state. Once a path was drawn it must be deleted.
The TClipPath callback function supports the same modes than TClosePath but the required actions
that must be executed are different. A clipping path is part of the graphics state. If the graphics state
contains already a clipping path, the existing path must be intersected with new one. The resulting
clipping path must then be stored in the graphics state.
If the path must also be filled or stroked, it is important to hold an unmodified version of the path in
memory so that the required path painting operation can be executed. The previously created
clipping region must of course be considered.
The mode fmNoFill has the meaning create the clipping region, but do not fill or stroke the path. So,
after the clipping region was created the path can be deleted from memory. This is the default
behavior. The combination of a path painting operator with a clipping path occurs seldom.

Previous topic: Vector Graphics

Next topic: PlaceImage, PlaceSigFieldValidateIcon