DynaPDF Manual - Page 635

Previous Page 634   Index   Next Page 636

Function Reference
Page 635 of 860
contain a space character and the function fntGetSpaceWidth() returns just a default width in this
case (the function name is GetSpaceWidth() in C#, Delphi, and VB .Net).
The space width is measured in text space like the member Advance of a kerning record. However,
the distance between two text records is measured in user space! So, the space width must be
transformed to user space before it can be compared with the distance between two text records. See
the description of the TShowTextArrayW callback function for further information.
TRestoreGraphicState
As the name of the function suggests the graphics state must be restored when the callback function
is executed. The graphics state stack is a LIFO (last in first out) data structure that stores copies of
the graphics state. The last element from the graphics state stack must be popped and the values
must be copied to the current graphics state.
It is guaranteed that this function is not executed without a preceeding TSaveGraphicState call.
Invalid restore graphics state operators are trated as an error. The parser breaks processing when it
encounters such an error.
The return value of the function must be zero. Any other return value breaks processing.
TSaveGraphicState
As the name suggests the current graphics state must be saved when the callback function is
executed. As already described at TRestoreGraphiState the graphics state stack is a LIFO (last in first
out) data structure that stores copies of the graphics state. The application must create a copy of the
current graphics state and push it onto the graphics state stack.
It is not guaranteed that all saved graphics states will be restored until the page was fully parsed.
The application must make sure that remaining copies of the graphics state will be released before
parsing the next page or terminating the application.
The return value of the function must be zero. Any other return value breaks processing.
TShowTextArrayA
This is the preferred callback function to develop text search algorithms. See also Sub string
coordinates for further information. The function returns the source strings which can be converted
to Unicode with TranslateRawCode(). TranslateRawCode() converts the source string on a per
character basis and calculates the width of that character in one pass.
The parameter Width represents the width of the entire text record. The source array provides also
the displacement vector Advance. Advance is a vector also if only coordinate is given; the y-
coordinate is always zero. Positive values of Advance move the cursor to the left; negative values
move it to the right in a non-rotated coordinate system. The string widths and the displacement
vector are measured in text space.
 

Previous topic: TBeginTemplate, TMulMatrix, TSetFont

Next topic: TShowTextArrayW, Image Extraction