Exemplo n.º 1
0
 * PDF Catalog View
 *  
 * @license GPLv3
 * 
 * @since       4.0.1
 * @package     eduTrac SIS
 * @author      Joshua Parker <*****@*****.**>
 */
$app = \Liten\Liten::getInstance();
$app->view->extend('_layouts/blank');
$app->view->block('blank');
// create new PDF document
$pdf = new \app\src\tcpdf\Tcpdf('landscape', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetTitle($catalog[0]['termCode'] . ' Course Catalog');
// set default header data
$pdf->SetHeaderData("", "", $catalog[0]['termCode'] . ' Course Catalog', "");
// set header and footer fonts
$pdf->setHeaderFont(array('freesans', '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array('freesans', '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, "20", PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin("12");
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// ---------------------------------------------------------
// set font
Exemplo n.º 2
0
$pdf->SetCreator(PDF_CREATOR);
// set default header data
$pdf->SetHeaderData('', '', 'Section Roster', '', '', '');
// set header and footer fonts
$pdf->setHeaderFont(array('freesans', '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array('freesans', '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, "20", PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin("12");
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set pdf page title
$pdf->SetTitle($sros[0]['courseSection']);
// ---------------------------------------------------------
// set font
$pdf->SetFont('freesans', '', 10);
// add a page
$pdf->AddPage();
// set cell padding
$pdf->setCellPaddings(1, 1, 1, 1);
// set cell margins
$pdf->setCellMargins(1, 1, 1, 1);
// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)
// set some text for student info
$txt1 = _h(get_option('institution_name')) . "<br />";
$txt1 .= "Section: " . _h($sros[0]['courseSection']) . " " . _h($sros[0]['secShortTitle']) . "<br />";
$txt1 .= "Instructor: " . get_name(_h($sros[0]['facID'])) . "<br />";
// writeHTMLCell