/** * Writes the header for a single page. * Use the passed $objPdf to access the pdf. * * @param class_pdf_tcpdf $objPdf */ public function writeHeader($objPdf) { $objPdf->SetY(3); $objPdf->SetFont('helvetica', '', 8); // Title $objPdf->MultiCell(0, 0, $objPdf->getTitle(), "B", "C"); // Line break $objPdf->Ln(30); }
/** * Add a table of contents. * To specifiy the position within the document, use the second param. * Every bookmark added via addBookmark() will be added. * * @param string $strTitle * @param int $intTargetPage * * @see class_pdf::addBookmark() * @return void */ public function addTableOfContents($strTitle, $intTargetPage = 2) { // add a new page for TOC $this->objPdf->addTOCPage(); $this->objPdf->selectColumn(0); $this->addMultiCell($strTitle); $this->objPdf->Ln(); // add table of content at page 1 $this->objPdf->addTOC($intTargetPage, $this->objPdf->getFontFamily(), ' . ', $strTitle); // end of TOC page $this->objPdf->endTOCPage(); }