DynaPDF Manual - Page 782

Previous Page 781   Index   Next Page 783

Function Reference
Page 782 of 787
= \\
= \ce#
= \\le#
\\LI [...] = \\LI [...] // No valid tag -> always processed as text
= \LI[...]
The function compares the first four characters of command tags which accept parameters . If the
sequence matches a command tag an additional backslash is required if the string should be output
as text.
It is also possible to fully disable alignment and command tags with the flag taPlainText that can be
passed to the parameter Align. Combine the flag with the wished alignment constant with a binary
or operator, e.g. (TTextAlign)(taRight | taPlainText). This can be useful when it is known that the
incomming text cannot contain alignment or command tags. Line breaks and so on are still
processed as usual but all kinds of alignment and command tags will be interpreted as plain text.
How to create multi-column text?
WriteFText() supports a callback function which can be used to create various formattings. The
callback function is required to print text into multiple columns.
The Visual Basic and VB .Net interfaces use events instead of callback functions. However, the usage
is identical but the event must be manually connected with the function ConnectPageBreakEvent()
so that the event can be raised.
A good example to demonstrate the usage of the callback function is the output of multi-column
text. In the following example we have a text file that contains the text that should be printed. The
text that we use in this example is not of interest, it must only be large enough so that WriteFText()
generates an OnPageBreak event. Note that it is also possible to create this event manually with the
command tag \np#.
Example (C++):
First, we define a structure which contains all variables we need to calculate the output rectangle.
we pass this structure to the SetOnPageBreakProc() function so that we don't need any global data.
struct TOutRect
void* iPDF;
// Active PDF instance
double PosX;
// X-coordinate of first output rectangle
double PosY;
// Y-coordinate of first output rectangle
double Width;
// Original width of the output rectangle
double Height;
// Original height of the output rectangle
double Distance; // Space between columns
SI32 Column;
// Current column
SI32 ColCount; // Number of columns

Previous topic: Special characters, Escape Sequences

Next topic: WriteFTextEx, WriteText

Start Chat