/** * adds item to list * * @param string $text * @param PHPRtfLite_Font $font * @param PHPRtfLite_ParFormat $parFormat * @param boolean $convertTagsToRtf * @return $this */ public function addItem($text, PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null, $convertTagsToRtf = true) { if ($font === null) { $font = $this->_font; } if ($parFormat === null) { $parFormat = $this->_parFormat; } $element = new PHPRtfLite_Element($this->_rtf, $text, $font, $parFormat); if ($convertTagsToRtf) { $element->setConvertTagsToRtf(); } $this->_items[] = $element; return $this; }
/** * writes text to container. * * @param string $text Text. Also you can use html style tags. Possible tags:<br> * strong, b- bold; <br> * em - ; <br> * i - italic; <br> * u - underline; <br> * br - line break; <br> * chdate - current date; <br> * chdpl - current date in long format; <br> * chdpa - current date in abbreviated format; <br> * chtime - current time; <br> * chpgn, pagenum - page number ; <br> * tab - tab * sectnum - section number; <br> * line - line break; <br> * page - page break; <br> * sect - section break; <br> * @param PHPRtfLite_Font $font font of text * @param PHPRtfLite_ParFormat $parFormat paragraph format, if null, text is written in the same paragraph. * @param boolean $convertTagsToRtf if false, then html style tags are not replaced with rtf code * @return PHPRtfLite_Element */ public function writeText($text, PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null, $convertTagsToRtf = true) { $element = new PHPRtfLite_Element($this->_rtf, $text, $font, $parFormat); if ($convertTagsToRtf) { $element->setConvertTagsToRtf(); } $this->_elements[] = $element; return $element; }
/** * constructor * * @param PHPRtfLite $rtf * @param string $text * @param PHPRtfLite_Font $font * @param PHPRtfLite_ParFormat $parFormat */ public function __construct(PHPRtfLite $rtf, $text, PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null) { parent::__construct($rtf, $text, $font, $parFormat); $this->setIsRtfCode(); }