/** * 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()); }
function Generate_Content() { PHPRtfLite::registerAutoloader(); $largerFont = new PHPRtfLite_Font(16, 'Courier New'); $largerFont->setBold(); $smallerFont = new PHPRtfLite_Font(12, 'Times New Roman'); $tableFont = new PHPRtfLite_Font(10, 'Courier New'); //Izveido pašu dokumentu $rtf = new PHPRtfLite(); $parHead = new PHPRtfLite_ParFormat(); $parHead->setSpaceBefore(3); $parHead->setSpaceAfter(8); $parBody = new PHPRtfLite_ParFormat(); $parBody->setSpaceBefore(1); //Izveido pirmo sekciju $sect =& $rtf->addSection(); $sect->writeText("Atzīmju izraksts", $largerFont, $parHead); $sect->writeText("Skolnieks: " . $this->studentName, $smallerFont, $parHead); for ($i = 0; $i < count($this->grades); $i++) { $grade = $this->grades[$i]; $sect->writeText(sprintf("%s %s %s", $grade["date"], $grade["lesson"], $grade["grade"]), $tableFont, $parBody); } $this->fileContents = $rtf; }
// *** rtf document instance *** $rtf = new PHPRtfLite(); // *** Add section *** $sect = $rtf->addSection(); // *** RTF Settings *** $arial12 = new PHPRtfLite_Font(12, 'Arial'); $arial14 = new PHPRtfLite_Font(14, 'Arial', '#000066'); //Fonts $fontHead = new PHPRtfLite_Font(12, 'Arial'); $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();
$rtf = new PHPRtfLite(); // *** Add section *** $sect = $rtf->addSection(); // *** RTF Settings *** $arial10 = new PHPRtfLite_Font(10, 'Arial'); $arial12 = new PHPRtfLite_Font(12, 'Arial'); $arial14 = new PHPRtfLite_Font(14, 'Arial', '#000066'); //Fonts $fontHead = new PHPRtfLite_Font(12, 'Arial'); $fontSmall = new PHPRtfLite_Font(3); $fontAnimated = new PHPRtfLite_Font(10); $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));