public function SetFont($family, $style = '', $size = null, $fontfile = '', $subset = 'default', $out = true) { if ($family === 'arial') { $fontfile = LIB_DIR . DIRECTORY_SEPARATOR . 'tcpdf' . DIRECTORY_SEPARATOR . 'fonts' . DIRECTORY_SEPARATOR . 'arial' . $style . '.php'; } parent::SetFont($family, $style, $size, $fontfile, $subset, $out); }
public function __construct($pagesize, $orientation, $title) { global $layout; parent::__construct($orientation, PDF_UNIT, $pagesize, true, 'UTF-8', false, false); $this->SetProducer('LMS Developers'); $this->SetSubject($title); $this->SetCreator('LMS ' . $layout['lmsv']); $this->SetDisplayMode('fullwidth', 'SinglePage', 'UseNone'); $this->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $this->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM); $this->SetHeaderMargin(PDF_MARGIN_HEADER); $this->SetFooterMargin(PDF_MARGIN_FOOTER); $this->setImageScale(PDF_IMAGE_SCALE_RATIO); $this->setLanguageArray($l); /* disable font subsetting to improve performance */ $this->setFontSubsetting(false); $this->AppendPage(); }
/** * This function is call automatically by TCPDF at the end of a page * It takes no parameters * * @access public */ public function Footer() { // prepare the text from the tranlated text $txt = ''; if ($this->_footerParam['form']) { $txt = HTML2PDF_locale::get('pdf05'); } if ($this->_footerParam['date'] && $this->_footerParam['hour']) { $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf03'); } if ($this->_footerParam['date'] && !$this->_footerParam['hour']) { $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf01'); } if (!$this->_footerParam['date'] && $this->_footerParam['hour']) { $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf02'); } if ($this->_footerParam['page']) { $txt .= ($txt ? ' - ' : '') . HTML2PDF_locale::get('pdf04'); } if (strlen($txt) > 0) { // replace some values $toReplace = array('[[date_d]]' => date('d'), '[[date_m]]' => date('m'), '[[date_y]]' => date('Y'), '[[date_h]]' => date('H'), '[[date_i]]' => date('i'), '[[date_s]]' => date('s'), '[[page_cu]]' => $this->getMyNumPage(), '[[page_nb]]' => $this->getMyAliasNbPages()); $txt = str_replace(array_keys($toReplace), array_values($toReplace), $txt); // draw the footer parent::SetY(-11); $this->SetFont('arial', 'I', 8); $this->Cell(0, 10, $txt, 0, 0, 'R'); } }
function init_pdf($pagesize, $orientation, $title) { global $layout; $pdf = new LMSTCPDF($orientation, PDF_UNIT, $pagesize, true, 'UTF-8', false, false); $pdf->invoice_type = ConfigHelper::getConfig('invoices.template_file'); $pdf->SetProducer('LMS Developers'); $pdf->SetSubject($title); $pdf->SetCreator('LMS ' . $layout['lmsv']); $pdf->SetDisplayMode('fullwidth', 'SinglePage', 'UseNone'); $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setLanguageArray($l); /* disable font subsetting to improve performance */ $pdf->setFontSubsetting(false); $pdf->AddPage(); return $pdf; }