DynaPDF Manual - Page 644

Previous Page 643   Index   Next Page 645

Function Reference
Page 644 of 874
If a required CMap is absent the Decoded parameter of the TShowTextArrayW callback function is
set to false and the string should be ignored in this case because no meaningful values can be
returned.
Inside the Callback Functions
The following sub-clauses describe important operations which must be executed in the callback
functions to achieve correct results.
TBeginTemplate
This callback function is executed when a Form XObject in PDF terms is painted (we call this object
type template in DynaPDF). The parameter BBox specifies the template's bounding box or visible
area measured in form space. The required mapping from form space to user space is specified by
the Matrix parameter (see also Coordinate Spaces). The Matrix parameter is optional and can be set
to NULL. In the latter case, the form matrix is set to the identity matrix.
If the form matrix is present then it must be multiplied with the current transformation matrix of the
graphics state as follows:
// m_GState represents the current graphics state
if (Matrix)
{
m_GState.Matrix = MulMatrix(m_GState.Matrix, *Matrix);
}
The corresponding TEndTemplate callback function is executed if the contents of a template were
fully processed. The definition of this callback function is optional because no specific code is
required to be executed.
Return values:
0 indicates success and processing continues.
1 means that the template should be skipped.
Any other return value breaks processing.
TMulMatrix
The TMulMatrix callback function is executed if the current transformation matrix must be
multiplied with a new one. When using the function MulMatrix() the matrix must be multiplied
with the one of the graphics state as follows:
// m_GState represents the current graphics state
m_GState.Matrix = MulMatrix(m_GState.Matrix, *Matrix);
The parameter Matrix is always set; it is not required to check whether the parameter is set to NULL.
 

Previous topic: Unicode conversion, External CMaps

Next topic: TSetFont, TRestoreGraphicState, TSaveGraphicState, TShowTextArrayA