|
It depends on the precise need.
If you want to insert a text with tabs, through any method that creates a text element with a given content or that changes the text content of an existing element, you have just to put "\t" characters in the given string. Example:
$doc->appendParagraph(text => "Before \t after");
It's possible to append a tab stop, then an additional text, to an existing text element. To do so, you should combine tabStop() which creates a free tab stop element, and extendText(), in order to append a tab stop then a new text after the tab stop. Example (where $p is a previously selected paragraph):
$doc->extendText($p, $doc->tabStop);
$doc->extendText($p, "after the tab stop");
In the last example, there is a alternative for the first instruction, thanks to appendTabStop(), so the sequence below does the same job:
$doc->appendTabStop($p);
$doc->extendText($p, "after the tab stop");
|