/** * tests addHeader with expected exception for all page header * @expectedException PHPRtfLite_Exception */ public function testAddHeaderAllException() { $this->_rtf->setOddEvenDifferent(); $this->_rtf->addHeader(PHPRtfLite_Container_Header::TYPE_ALL); $this->_rtf->getContent(); }
Since RTF files are text files, it\'s easy to produce RTF with many programming languages, like Perl, Java, C++, Pascal, COBOL, or Lisp. Perl, for example, has the RTF::Writer module for this purpose. '; $times12 = new PHPRtfLite_Font(13, 'Times new Roman'); $arial14 = new PHPRtfLite_Font(14, 'Arial', '#000066'); $parFormat = new PHPRtfLite_ParFormat(); //rtf document $rtf = new PHPRtfLite(); //borders $borderFormatBlue = new PHPRtfLite_Border_Format(1, '#0000ff'); $borderFormatRed = new PHPRtfLite_Border_Format(2, '#ff0000'); $border = new PHPRtfLite_Border($rtf, $borderFormatBlue, $borderFormatRed, $borderFormatBlue, $borderFormatRed); $rtf->setBorder($border); $rtf->setBorderSurroundsHeader(); $rtf->setBorderSurroundsFooter(); //headers $rtf->setOddEvenDifferent(); $header = $rtf->addHeader(PHPRtfLite_Container_Header::TYPE_LEFT); $header->writeText("PHPRtfLite class library. Left document header. This is page - <pagenum> of <pagetotal> -", $times12, $parFormat); $header = $rtf->addHeader(PHPRtfLite_Container_Header::TYPE_RIGHT); $header->writeText("PHPRtfLite class library. Right document header. This is page - <pagenum> of <pagetotal> -", $times12, $parFormat); //section 1 $sect = $rtf->addSection(); $sect->setPaperHeight(16); $sect->setPaperWidth(25); //Borders overridden: No Borders $border = PHPRtfLite_Border::create($rtf, 0); $sect->setBorder($border); $sect->setSpaceBetweenColumns(1); $sect->setNumberOfColumns(2); $sect->setLineBetweenColumns(); writeSectionText($sect, $arial14, $times12, $text, $text2, $text3);