DynaPDF Manual - Page 601

Previous Page 600   Index   Next Page 602

Function Reference
Page 601 of 839
A complete graphics state contains the following variables:
Parameter
Type
Initial Value
CharSpacing
float
0.0f
Clipping Path
Vector array
Crop box or Media box
DashPattern
float*
NULL (Solid line)
DashPhase
UI32
0
FillColor
double[32]
Black
FillColorSpace
TExtColorSpace, IColorSpace*
esDeviceGray, NULL
FillPattern
IPattern*
NULL
Font
IFont*
NULL
FontSize
double
0.0
FontType
TFontType
-
Leading
float
0.0f (Info only, see below)
LineCapStyle
TLineCapStyle
csButtCap
LineJoinStyle
TLineJoinStyle
jsMiterJoin
LineWidth
float
1.0f
Matrix
TCTM
{1, 0, 0, 1, 0, 0}
MiterLimit
float
10.0f
StrokeColor
double[32]
Black
StrokeColorSpace
TExtColorSpace, IColorSpace*
esDeviceGray, NULL
StrokePattern
IPattern*
NULL
TextDrawMode
TDrawMode
dmNormal
TextScale
float
100.0f
WordSpacing
float
0.0f
The current graphics state must be initialized with the above default values before parsing a new
page. Templates (Form XObjects in PDF terms) inherit the graphics state of the parent object that
paints the template.
The parameter Leading is provided for information only because it is already considered in the text
matrix of all text callback functions (see Coordinate Spaces for further information).
The variables which make up the graphics state are normally stored in a structure or class so that the
graphics state can be saved and restored if corresponding operators are executed.
If the TSaveGraphicState callback function is executed, the application must create a copy of the
current graphics state and push it onto the graphics state stack. In the corresponding
TRestoreGraphicState callback function, the last element of the graphics state stack must be popped
and copied to the current graphics state.
A correct handling of the graphics state is always required if the application needs to compute
coordinates of graphic objects.
Note also that the graphics state can be saved and restored very often. The maximum allowed
nesting level of save/restore graphics state operators in PDF is 28. The application should not
depend on this limit but it can be used for optimizations, e.g. to create a graphics state cache.
 

Previous topic: The Graphics State

Next topic: Coordinate Spaces