* elements. */ // A monospaced font for the page number is mandatory to get the right alignment $bookmark_templates [0] = '<table border="0" cellpadding="0" cellspacing="0" style="background-color:#EEFAFF"><tr><td width="155mm"><span style="font-family:times;font-weight:bold;font-size:12pt;color:black;">#TOC_DESCRIPTION#</span></td><td width="25mm"><span style="font-family:courier;font-weight:bold;font-size:12pt;color:black;" align="right">#TOC_PAGE_NUMBER#</span></td></tr></table>'; $bookmark_templates [1] = '<table border="0" cellpadding="0" cellspacing="0"><tr><td width="5mm"> </td><td width="150mm"><span style="font-family:times;font-size:11pt;color:green;">#TOC_DESCRIPTION#</span></td><td width="25mm"><span style="font-family:courier;font-weight:bold;font-size:11pt;color:green;" align="right">#TOC_PAGE_NUMBER#</span></td></tr></table>'; $bookmark_templates [2] = '<table border="0" cellpadding="0" cellspacing="0"><tr><td width="10mm"> </td><td width="145mm"><span style="font-family:times;font-size:10pt;color:#666666;"><i>#TOC_DESCRIPTION#</i></span></td><td width="25mm"><span style="font-family:courier;font-weight:bold;font-size:10pt;color:#666666;" align="right">#TOC_PAGE_NUMBER#</span></td></tr></table>'; // add other bookmark level templates here ... // add table of content at page 1 // (check the example n. 45 for a text-only TOC $pdf->addHTMLTOC ( 1, 'INDEX', $bookmark_templates, true, 'B', array ( 128, 0, 0 ) ); // end of TOC page $pdf->endTOCPage (); // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . // --------------------------------------------------------- // Close and output PDF document $pdf->Output ( 'example_059.pdf', 'I' ); //============================================================+ // END OF FILE //============================================================+
$pdf->SetPrintFooter(false); } $pdf->addTOCPage(); $pdf->writeHTML('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><div align="center"><font size="25px" ><b>VP Genetic Results</b></font></div> <br><br><br><br><div align="center">Prepared for: ' . $file_code . '</div> <div align="center">' . date('M j, Y') . '</div> <br><br><br><br><div align="center"></div> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>', true, false, true, false, ''); // write the TOC title and/or other elements on the TOC page $pdf->SetFont('', 'B', 16); //$pdf->writeHTML('<br><br><br><br><div align="center">Table content of User report</div>', true, false, true, false, ''); $pdf->Ln(); $pdf->SetFont('helvetica', '', 10); // define styles for various bookmark levels $bookmark_templates = array(); // A monospaced font for the page number is mandatory to get the right alignment $bookmark_templates[0] = '<table border="0" cellpadding="0" cellspacing="0" ><tr><td width="155mm"><span style="font-weight:bold;font-size:12pt;color:black;">#TOC_DESCRIPTION#</span></td><td width="25mm"><span style="font-family:courier;font-weight:bold;font-size:12pt;color:black;" align="right">#TOC_PAGE_NUMBER#</span></td></tr></table>'; $bookmark_templates[1] = '<table border="0" cellpadding="0" cellspacing="0"><tr><td width="5mm"> </td><td width="150mm"><span style="font-size:11pt;color:green;">#TOC_DESCRIPTION#</span></td><td width="25mm"><span style="font-family:courier;font-weight:bold;font-size:11pt;color:green;" align="right">#TOC_PAGE_NUMBER#</span></td></tr></table>'; $bookmark_templates[2] = '<table border="0" cellpadding="0" cellspacing="0"><tr><td width="10mm"> </td><td width="145mm"><span style="font-size:10pt;color:#666666;"><i>#TOC_DESCRIPTION#</i></span></td><td width="25mm"><span style="font-family:courier;font-weight:bold;font-size:10pt;color:#666666;" align="right">#TOC_PAGE_NUMBER#</span></td></tr></table>'; // add other bookmark level templates here ... // add table of content at page 1 // (check the $file_code n. 45 for a text-only TOC $pdf->addHTMLTOC(1, 'INDEX', $bookmark_templates, true, 'B', array(128, 0, 0)); // end of TOC page $pdf->endTOCPage(); //Change To Avoid the PDF Error ob_end_clean(); $pdf->Output('user-report.pdf', 'D'); ?> <!--<tr bgcolor="#CCCCCC" style="background-color:#CCC #FFFFFF">