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

DynaPDF Manual - Page 99

Previous Page 98   Index   Next Page 100

Table Functions
Page 99 of 750
Width > 0 and Height > 0 -> The template is scaled to the given width and height. The aspect
ratio is not preserved. If the flag tfScaleToRect is set, the template is scaled so that both sides
fit into the given width and height and the aspect ratio is preserved.
The parameters Width and Height are not exchanged if the cell uses a landscape orientation.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
SetCellText
Syntax:
LBOOL tblSetCellText(
const ITBL* Table, // Table pointer
UI32 Row,
// Row index
UI32 Col,
// Column index
TTextAlign HAlign, // Horizontal alignment
TCellAlign VAlign, // Vertical alignment
const char* Text,
// The text to be drawn
UI32 Len)
// Length in characters
The function inserts the specified text into the cell. Text is always a foreground object. The cell will be
expanded if necessary.
Text can be processed in different ways. By default the text is output with WriteFText(). WriteFText()
supports a lot of format tags. These tags are also supported in a table with exception of a page break
tag.
To avoid line breaks it is possible to set the flag tfNoLineBreak with SetFlags(). The flag is inherited
from the table, column, row, and cell, in this order. If set, the text is output with WriteText() instead.
Since this function doesn't support format tags, the text is processed as plain text.
The font and font size can be set with SetFont() and with SetFontSize(). Note that a table has its own
versions of these functions.
If the cell uses a landscape orientation then the text flows to left or to right depending on the
orientation and if the flag tfNoLineBreak is not set. The row height must be set to value greater zero
in this case. If the text does not fit into the cell then the column width will be expanded. If the flag
tfNoLineBreak is set, then the height of the row will be expanded if necessary.
If the cell uses a portrait orientation and if the flag tfNoLineBreak is not set, then text flows from top
to bottom or bottom to top, depending on the orientation. The row height will be expanded if
necessary. If the flag tfNoLineBreak is set, then the column width will be expanded if necessary.
Remarks:
This function is implemented in an Ansi and Unicode compatible version. Ansi strings are
interpreted as UTF-8 if the flag gfAnsiStringIsUTF8 is set the in the associated PDF instance. See
SetGStateFlags() for further information.
 

Previous topic: SetCellTemplate

Next topic: SetColorEx