Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 530

Previous Page 529   Index   Next Page 531

Function Reference
Page 530 of 750
Although the TDrawShading callback function is defined there is no way to process shadings at this
time. Shadings can only be rastered to an image to get a meaningful result. However, such a feature
is not available yet.
The content parser is not part of the Visual Basic interface due to the bad support for callback
functions. Preferred programming languages are C/C++ and Delphi because these programming
languages offer optimal execution speed and the usage is relatively simple. The usage with .Net
languages is of course possible too but due to the missing support for pointers it is somewhat more
complicated. However, the execution speed in C# is very good.
The Graphics State
An application that uses the content parser must maintain an internal graphics state stack that stores
the current graphics state in a LIFO (last in first out) data structure. Depending on what kind of
information should be extracted only a few members of the graphics state maybe required. For
example, an application that extracts text from a PDF file can ignore path painting parameters like
the current line cap style, line width and so on.
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
double*
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).
 

Previous topic: ParseContent

Next topic: Coordinate Spaces