DynaPDF Manual - Page 109

Previous Page 108   Index   Next Page 110

Table Functions
Page 109 of 839
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
SetCellTemplate
Syntax:
LBOOL tblSetCellTemplate(
const ITBL* Table, // Table pointer
SI32 Row,
// Row index or -1
SI32 Col,
// Column index or -1
LBOOL ForeGround,
// If true, the cell will be expanded if necessary
TCellAlign HAlign, // Horizontal alignment
TCellAlign VAlign, // Vertical alignment
UI32 TmplHandle,
// Template handle
float Width,
// Must be greater or equal zero
float Height)
// Must be greater or equal zero
The function inserts a template into the specified cell. A template can contain contents from external
sources like PDF or EMF pages as well as anything that can be drawn on a page (with exception of
interactive objects like form fields or annotations).
Please note that the table creates no copy of the template. Template handles are bound on the PDF
instance in which they were created and all templates will be deleted when the PDF file in memory is
closed or when FreePDF() will be called.
Therefore, it is not possible to draw a table with templates into different PDF files.
If the template is inserted as a background object, then it will be clipped if it does not fit into the cell
boundary. A cell can contain a background and a foreground object.
A template can also be added to the table as background object.
Foreground objects have a strong width and height. That means the cell will be expanded if
necessary.
Templates can be scaled into the cell as follows:
Width = 0 and Height = 0 -> The template is scaled to the cell width or height depending on the
cell orientation. The aspect ratio will be preserved. If the flag tfScaleToRect is set, the template
is scaled so that both sides fit into the cell width and height. The row height must be greater
zero to achieve a meaningful result.
Width > 0 and Height = 0 or Width = 0 and Height > 0 -> The template is scaled to the given
width or height. The aspect ratio will be preserved. If the flag tfScaleToRect is set, the
template is scaled so that both sides fit into the given width or height and into cell width or
height depending on which side is missing. If the parameter Height and the row height are
zero then the flag tfScaleToRect has no effect.
 

Previous topic: SetCellOrientation, SetCellTable

Next topic: SetCellText