/** * tests getContent(). */ public function testGetContent() { $this->_parFormat->setIndentLeft(5); $this->_parFormat->setIndentRight(5); $this->_parFormat->setSpaceBefore(5); $this->_parFormat->setSpaceAfter(5); $this->_parFormat->setIndentFirstLine(3); $this->_parFormat->setSpaceBetweenLines(1.2); $this->_parFormat->setShading(50); $this->assertEquals('\\ql \\fi1701 \\li2835 \\ri2835 \\sb100 \\sa100 \\sl288 \\shading5000 ', $this->_parFormat->getContent()); }
$fontLink = new PHPRtfLite_Font(10, 'Helvetica', '#0000cc'); $parNames = new PHPRtfLite_ParFormat(); $parNames->setBackgroundColor('#FFFFFF'); $parNames->setIndentLeft(0); $parNames->setSpaceBefore(0); $parNames->setSpaceAfter(0); $parHead = new PHPRtfLite_ParFormat(PHPRtfLite_ParFormat::TEXT_ALIGN_CENTER); $parHead->setSpaceBefore(3); $parHead->setSpaceAfter(8); $parHead->setBackgroundColor('#baf4c1'); $parGen = new PHPRtfLite_ParFormat(PHPRtfLite_ParFormat::TEXT_ALIGN_CENTER); $parGen->setSpaceBefore(0); $parGen->setSpaceAfter(8); $parGen->setBackgroundColor('#baf4c1'); $parSimple = new PHPRtfLite_ParFormat(); $parSimple->setIndentLeft(2.5); $parSimple->setIndentRight(0.5); // *** Generate title of RTF file *** $pers = $dbh->query("SELECT * FROM humo_persons WHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber='{$family_id}'"); @($persDb = $pers->fetch(PDO::FETCH_OBJ)); // *** Use person class *** $pers_cls = new person_cls(); $pers_cls->construct($persDb); $name = $pers_cls->person_name($persDb); $title = __('Ancestor report') . __(' of ') . $name["standard_name"]; //$sect->writeText($title, $arial14, new PHPRtfLite_ParFormat()); $sect->writeText($title, $arial14, $parHead); $file_name = date("Y_m_d_H_i_s") . '.rtf'; // *** FOR TESTING PURPOSES ONLY *** if (@file_exists("../gedcom-bestanden")) { $file_name = '../gedcom-bestanden/' . $file_name;
$fontSmall = new PHPRtfLite_Font(3); $fontAnimated = new PHPRtfLite_Font(10); $fontLink = new PHPRtfLite_Font(10, 'Helvetica', '#0000cc'); $parBlack = new PHPRtfLite_ParFormat(); $parBlack->setIndentRight(12.5); //$parBlack->setBackgroundColor('#000000'); $parBlack->setSpaceBefore(12); $parHead = new PHPRtfLite_ParFormat(); $parHead->setSpaceBefore(3); $parHead->setSpaceAfter(8); $parHead->setBackgroundColor('#baf4c1'); $parSimple = new PHPRtfLite_ParFormat(); $parSimple->setIndentLeft(1); $parSimple->setIndentRight(0.5); $par_child_text = new PHPRtfLite_ParFormat(); $par_child_text->setIndentLeft(0.5); $par_child_text->setIndentRight(0.5); //$rtf->setMargins(3, 1, 1 ,2); // *** Generate title of RTF file *** @($persDb = $db_functions->get_person($main_person)); // *** Use class to process person *** $pers_cls = new person_cls(); $pers_cls->construct($persDb); $name = $pers_cls->person_name($persDb); if (!$descendant_report == false) { $title = __('Descendant report') . __(' of ') . $name["standard_name"]; } else { $title = __('Family group sheet') . __(' of ') . $name["standard_name"]; } //$sect->writeText($title, $arial14, new PHPRtfLite_ParFormat()); $sect->writeText($title, $arial14, $parHead);
$fontLink = new PHPRtfLite_Font(10, 'Helvetica', '#0000cc'); $parBlack = new PHPRtfLite_ParFormat(); $parBlack->setIndentRight(9); $parBlack->setBackgroundColor('#000000'); $parBlack->setSpaceBefore(12); $parHead = new PHPRtfLite_ParFormat(); $parHead->setSpaceBefore(3); $parHead->setSpaceAfter(8); $parSimple = new PHPRtfLite_ParFormat(); $parSimple->setIndentLeft(5); $parSimple->setIndentRight(0.5); $parPhp = new PHPRtfLite_ParFormat(); $parPhp->setShading(5); $border = PHPRtfLite_Border::create($rtf, 1, '#000000', 'dash', 0.3); $parPhp->setBorder($border); $parPhp->setIndentLeft(5); $parPhp->setIndentRight(0.5); //section $sect = $rtf->addSection(); //table $table = $sect->addTable(); $table->addRows(1); $table->addRows(1); $table->addColumn(1); $table->addColumn(14); $cell = $table->getCell(1, 2); $cell->writeText('Testing paragraphs in table cells.', new PHPRtfLite_Font(14, 'Arial'), $parHead); $cell = $table->getCell(2, 2); $cell->addEmptyParagraph($fontSmall, $parBlack); $cell->writeText('Various paragraphs', $fontHead, $parHead); $par = new PHPRtfLite_ParFormat('center');