Adds a text string specified by Text to the cell
using the font specified by Font (if present) or the table's
default font specified upstream via the Table.Font property.
More than one text string can be added to a cell via multiple calls
to AddText.
This method's parameters are almost identical to that
of Canvas.DrawText
except that the X, Y, Width and Height paramaters
are copied from this cell's respective properties.
There are three extra parameters not used in DrawText: IndentX, IndentY
and Expand.
Param is a PdfParam object or parameter string specifying
the following text drawing parameters.
- IndentX, IndentY (optional) - the horizontal
and vertical indents of the text relative to the cell's upper-left
corner, 0 by default.
- Expand (optional) - if set to True,
the cell expands vertically to accommodate the entire
string being added. Side effect: cell and overall table height may change.
If set to False, the cell size is fixed
and only a portion of the string that fits will be drawn. False by default.
- Size (optional) - the font size, 10 by default.
- Alignment (optional) - text alignment, left (0) by default,
other valid values are right (1) and center (2).
The right and center alignment values
require that Width be specified as well.
- Rendering (optional) - font rendering, valid values described in
Section 6.1.2 - Rendering Parameter.
- Color (optional) - font color, black by default.
- Angle (optional) - angle (in degrees) by which the text should be
rotated counter-clockwise around the upper-left corner of
the bounding box.
- Spacing (optional) - the distance between individual lines of text,
1 by default.
- Tab (optional) - the size of a tab indent, 10 "space" characters by default.
- ReverseHebrewArabic (optional) - reverses the sequence of Hebrew and Arabic characters
in a string if set to True.
- Html (optional) - if set to True, the text string is
to be treated as HTML. False by default. For
more information on HTML support, see Section 6.4 - HTML Support.
If this parameter is set to True, the Alignment, Tab
and ReverseHebrewArabic parameters are ignored.
The method returns the number
of printed characters. This number may be less than the length
of the original text string if the entire string did not fit
in the cell and Expand is set to False.
If Expand is set to True, all characters are usually printed,
except if the cell is too narrow even for a single character.
Usage:
Table.Font = MyFont
Table.At(1, 2).AddText "Hello World!", "expand=true"
For more information on tables,
see Chapter 7 - Tables.
For more information on text and fonts, see
Chapter 6 - Text and Fonts.
For the full description of the DrawText method, see
Section 6.1 - Overview of Canvas.DrawText method.