function loadPage() { // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->titulo = $this->getPlan(); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Red de Universidades Anahuac'); $pdf->SetTitle('Plan Estrategico'); $pdf->SetSubject($this->getPlan()); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings //$pdf->setLanguageArray($l); // --------------------------------------------------------- // set font $pdf->SetFont('helvetica', 'N', 11); // add a page $pdf->AddPage(); $pdf->SetY(5); $html = "\n<!-- EXAMPLE OF CSS STYLE -->\n<style> \n\ttd{\n\tborder:1px solid #666;\n\t}\n\t\n\ttd.title{\n\tbackground:#E5E5E5;\n\tpadding:10px;\n\t}\n \n</style> <br />"; $html .= $this->Model->getLineas(); // output the HTML content $pdf->writeHTML($html, true, false, true, false, ''); //Close and output PDF document $pdf->Output('plan_operativo.pdf', 'I'); }
function ProcessRequest() { // $pdf = $this->Pdf; //============================================================+ // File name : example_003.php // Begin : 2008-03-04 // Last Update : 2013-05-14 // // Description : Example 003 for TCPDF class // Custom Header and Footer // // Author: Nicola Asuni // // (c) Copyright: // Nicola Asuni // Tecnick.com LTD // www.tecnick.com // info@tecnick.com //============================================================+ /** * Creates an example PDF TEST document using TCPDF * @package com.tecnick.tcpdf * @abstract TCPDF - Example: Custom Header and Footer * @author Nicola Asuni * @since 2008-03-04 */ // Include the main TCPDF library (search for installation path). // require_once('tcpdf_include.php'); // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Nicola Asuni'); $pdf->SetTitle('TCPDF Example 003'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set some language-dependent strings (optional) if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) { require_once dirname(__FILE__) . '/lang/eng.php'; $pdf->setLanguageArray($l); } // --------------------------------------------------------- // set font $pdf->SetFont('times', 'BI', 12); // add a page $pdf->AddPage(); // set some text to print $txt = <<<EOD TCPDF Example 003 Custom page header and footer are defined by extending the TCPDF class and overriding the Header() and Footer() methods. EOD; // print a block of text using Write() $pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0); // --------------------------------------------------------- //Close and output PDF document $pdf->Output('example_003.pdf', 'I'); //============================================================+ // END OF FILE //============================================================+ // $this->Save(); }
function pdfGen($group_name, $mode = NULL, $start_date, $end_date, $stats, $l, $title, $path_www) { global $centreon_path; // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator("PDF Reports Module"); $pdf->SetAuthor(getGeneralOptInfo("pdfreports_report_author")); //$pdf->SetAuthor('Fully Automated Nagios'); $pdfTitle = $title . " " . $group_name; //$pdfTitle = "Rapport de supervision du hostgroup ".$group_name; $pdf->SetTitle($pdfTitle); //$pdf->SetSubject('TCPDF Tutorial'); //$pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // define default header data $header = $title . " " . $group_name; //$header = "Rapport de supervision du hostgroup ".$group_name; //$ip = $_SERVER['HOSTNAME']; $startDate = date("d/m/Y", $start_date); $time = time(); $endDate = date("d/m/Y", $time); $string = _("From") . " " . strftime("%A", $start_date) . " " . $startDate . " " . _("to") . " " . strftime("%A", $time) . " " . $endDate . "\n"; // set default header data $pdf->SetHeaderData('../../../img/headers/' . getGeneralOptInfo("pdfreports_report_header_logo"), PDF_HEADER_LOGO_WIDTH, $header, $string); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font $pdf->SetFont('helvetica', '', 12); // add a page $pdf->AddPage(); //Column titles $header = array('Status', 'Time', 'Total Time', 'Mean Time', 'Alert'); // Pie chart Generation $piechart_img = pieGen($stats, $mode); //Data loading $data = $pdf->LoadData($stats); // print colored table //$pdf->ColoredTable($header, $data,$chart_img); if ($mode == "hgs") { // Hostgroup $pdf->ColoredTable($header, $data, $piechart_img, $path_www); } else { if ($mode == "sgs") { // Servicegroup $pdf->ServicesColoredTable($header, $data, $piechart_img, $path_www); } } // --------------------------------------------------------- //génération d'un nom de pdf $endDay = date("d", $time); $endYear = date("Y", $time); $endMonth = date("m", $time); $pdfDirName = getGeneralOptInfo("pdfreports_path_gen") . $endYear . $endMonth . $endDay . "/"; $pdfFileName = $pdfDirName . $endYear . "-" . $endMonth . "-" . $endDay . "_" . $group_name . ".pdf"; if (!is_dir($pdfDirName)) { mkdir($pdfDirName); } //Close and output PDF document $pdf->Output($pdfFileName, 'F'); return $pdfFileName; }
} } // create new PDF document $custom_layout = array(80, $totalProductos * 8.300000000000001 + 162); $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, $custom_layout, true, 'UTF-8', false); //SET DOCUMENT INFORMATION $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Recaudacion'); $pdf->SetTitle('Programa de Servicio de Salud'); $pdf->SetSubject('Detalle programa paciente'); $pdf->SetKeywords('Paciente, PSS, Programa'); //$pdf->SetHeaderData('../../img/logo.jpg', PDF_HEADER_LOGO_WIDTH,'SERVICIO DE SALUD ARICA ','HOSPITAL REGIONAL DE ARICA Y PARINACOTA'); $pdf->setHeaderFont(array('helvetica', '', 18)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(4, 5, 5, 1); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(0); $pdf->SetAutoPageBreak(TRUE, 0); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setLanguageArray($l); $pdf->setFontSubsetting(true); $pdf->SetFont('helvetica', '', 9, '', true); $pdf->setPrintFooter(false); //CREA UNA PAGINA $pdf->AddPage('L', 'A4'); //CARGA DE CLASES Y METODOS require_once '../../class/Tipo_Producto.class.php'; $objTipPro = new Tipo_Producto(); require_once '../../class/Nota_Credito.class.php'; $objNot = new Nota_Credito();
} } // create new PDF document $pdf = new MYPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('von-Buelow-Gymnasium'); $pdf->SetTitle('Bemerkungen zur Lernentwicklung'); $pdf->SetSubject(''); $pdf->SetKeywords(''); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set marginsfile:///home/rft/Buelow/webform/auswertung $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, 25); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set some language-dependent strings (optional) if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) { require_once dirname(__FILE__) . '/lang/eng.php'; $pdf->setLanguageArray($l); } // set pdf viewer preferences $pdf->setViewerPreferences(array('Duplex' => 'DuplexFlipLongEdge')); //Doppelseitiger Druck in einem Befehl $pdf->SetBooklet(true, 15, 25);
<td width="578" align="center">Pág ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages() . '</td> </tr> </table>'; $this->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'left', $autopadding = true); $this->Image('@' . $logoEmizor, '7', '128', 4, 12, '', 'www.emizor.com', 'T', false, 300, '', false, false, 0, false, false, false); $this->Image('@' . $emizorAvion, '145', '265', 5, 8, '', 'www.emizor.com', 'T', false, 300, '', false, false, 0, false, false, false); } } $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('ipxserver'); $pdf->SetTitle('Nota de Entrega'); $pdf->SetSubject('Primera Nota'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // set margins $pdf->SetMargins(15, 20, 15); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // borra la linea de arriba en el area del header $pdf->setPrintHeader(false); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set some language-dependent strings (optional) if (@file_exists('/includes/tcpdf/examples/lang/spa.php')) { require_once '/includes/tcpdf/examples/lang/spa.php'; $pdf->setLanguageArray($l); } $pdf->SetFont('helvetica', 'B', 11); $nit = $invoice->account_nit; $nfac = $invoice->invoice_number; $nauto = $invoice->number_autho;
public function cetak($idquotationsales = null, $idrefstore = null) { if ($idquotationsales == null) { exit('Data Tidak Tersedia'); } $data = $this->orm->quotationsales->where('idquotationsales', $idquotationsales)->fetch(); if (count($this->orm->quotationsales->where('idquotationsales', $idquotationsales)) == 0) { echo "<h3>Data Tidak Tersedia</h3>"; exit; } //check from web if ($idrefstore == null) { $email = $_SESSION['user']['email']; $idrefstore = $_SESSION['user']['idrefstore']; } else { //from mobile $email = $this->input->post('email'); } ini_set('memory_limit', '512M'); $this->load->library('TCPDF'); // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'A4', true, 'UTF-8', false); // set document information $pdf->SetCreator(WEB_TITLE); $pdf->SetAuthor($email); $pdf->SetTitle("Quotation - " . $data['nomor']); $pdf->SetSubject($data['nomor']); $pdf->nomor = $data['nomor']; $pdf->tanggal = $data['tanggal']; $pdf->namaPelanggan = $data->pelanggan['namapelanggan']; $pdf->dibuat_oleh = $data['dibuat_oleh']; $pdf->oleh = $email; $pdf->store = $this->orm->refstore->where('idrefstore', $idrefstore)->fetch(); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $pdf->SetMargins(5, 63, 5); $pdf->SetHeaderMargin(14); $pdf->SetFooterMargin(80); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, 80); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, 80); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // --------------------------------------------------------- // set default font subsetting mode $pdf->setFontSubsetting(true); // Set font // dejavusans is a UTF-8 Unicode font, if you only need to // print standard ASCII chars, you can use core fonts like // helvetica or times to reduce file size. // use the font $pdf->SetFont('times', '', 10, '', false); // Add a page // This method has several options, check the source code documentation for more information. $resolution = array(310, 210); $pdf->AddPage('L', $resolution); // Set some content to print $html = ' <style> body { letter-spacing:5px; } </style> <style type="text/css"> .rotate-text { /* Safari */ -webkit-transform: rotate(-90deg); /* Firefox */ -moz-transform: rotate(-90deg); /* IE */ -ms-transform: rotate(-90deg); /* Opera */ -o-transform: rotate(-90deg); /* Internet Explorer */ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); } .border-table{ border:0.5px solid #000; } table { padding-top:2px; } </style> <body> <table border="1"> <tr><th style="text-align: center;" width="60"> No </th><th width="180" style="text-align: center;"> Nama Barang </th><th style="text-align: center;" width="100"> Jumlah Barang </th><th style="text-align: center;" width="300"> Harga Satuan </th><td style="text-align: center; "width="300"> Keterangan </td></tr> '; $no = 1; foreach ($this->orm->quotationsalesdetail->where('idquotationsales', $idquotationsales) as $row) { $html .= "<tr><td>" . $no . "</td><td>" . $row->refbarang['namabarang'] . "</td><td style=\"text-align: right;\">" . $row['jumlahbarang'] . "</td><td style=\"text-align: right;\">" . number_format($row['hargasatuan'], 0, ',', '.') . "</td><td>" . $row['keterangan'] . "</td></tr>"; $no++; } $html .= '</table> </body>'; //print_r($html); exit; // Print text using writeHTMLCell() $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); //$pdf->writeHTML($html, true, 0, true, true); // --------------------------------------------------------- // Close and output PDF document // This method has several options, check the source code documentation for more information. $pdf->Output("Quotation - " . $data['nomor'], 'I'); //============================================================+ // END OF FILE //============================================================+ }
$this->setPageMark(); } public function Footer() { //$image_file = "img/pie.jpg"; //$this->Image($image_file, 7, 250, 198, 23, 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false); } } // create new PDF document $pdf = new MYPDF(); //set document information $pdf->SetAuthor('DIRECCION DE PENSIONES'); $pdf->SetTitle('DEL MUNICIPIO DE OAXACA DE JUÁREZ OAX'); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $pdf->SetMargins(0, PDF_MARGIN_TOP, 0); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $resolution = array(216, 355); $consultaTram = "SELECT idContrato, fecha, titular, nombre, importePrestamo, MontoRedocumentacion,sindicato,idSindicato FROM repAltasRedocumenta ORDER BY idSindicato ASC"; $consulta = mysql_query($consultaTram); $pdf->AddPage('L', $resolution); $pdf->SetFont('helvetica', '', 10); $pdf->MultiCell(334, 20, 'RESUMEN DE ALTAS Y REDOCUMENTACION DE PRESTAMOS', 0, 'C', false, 1, 12, 20, true, 0, true, true, 0, 'M', false); $pdf->MultiCell(334, 20, 'CONSULTA DEL ' . $fechadeInicio . ' AL ' . $fechadeFin, 0, 'C', false, 1, 12, 25, true, 0, true, true, 0, 'M', false); //$pdf->MultiCell(200, 5, 'FECHA INICIAL: '.$fechadeInicio, 0, 'C', false, 0, 0, 25, true, 0, true, true, 0, 'M', false); //$pdf->MultiCell(200, 5, 'FECHA FINAL: '.$fechadeFin, 0, 'C', false, 0, 155, 25, true, 0, true, true, 0, 'M', false); //$pdf->setPageOrientation('L'); $Cont = 1;
// $this->Cell(0, 10, 'Sayfa '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M'); } } // create new PDF document $pdf = new MYPDF('L', PDF_UNIT, 'A3', true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('MYK'); $pdf->SetTitle('Denetim Rapor'); $pdf->SetSubject('Denetim Rapor'); // $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins // $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetMargins(1, PDF_MARGIN_TOP, 1); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set default font subsetting mode $pdf->setFontSubsetting(true); // Set font // dejavusans is a UTF-8 Unicode font, if you only need to // print standard ASCII chars, you can use core fonts like // helvetica or times to reduce file size. $pdf->SetFont('DejaVuSans', '', 7, '', true); // $pdf->setLanguageArray($l); // Add a page
$this->setPageMark(); } } // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); //SET DOCUMENT INFORMATION $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Recaudacion'); $pdf->SetTitle('Programa de Servicio de Salud'); $pdf->SetSubject('Detalle programa paciente'); $pdf->SetKeywords('Paciente, PSS, Programa'); //$pdf->SetHeaderData('../../img/logo.jpg', PDF_HEADER_LOGO_WIDTH,'SERVICIO DE SALUD ARICA ','HOSPITAL REGIONAL DE ARICA Y PARINACOTA'); $pdf->setHeaderFont(array('helvetica', '', 6)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(3, 5, 3); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, 15); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setLanguageArray($l); $pdf->setFontSubsetting(true); $pdf->SetFont('helvetica', '', 8, '', true); //CREA UNA PAGINA $pdf->AddPage('L', 'A4'); //RECEPCION VARIABLE if ($_REQUEST['id_paciente']) { $id_paciente = $_REQUEST['id_paciente']; } if ($_REQUEST['cta_cte']) { $cta_cte = $_REQUEST['cta_cte'];
public function actionCetaklaporan($tgl_awal, $tgl_akhir, $toko, $status) { $criteria = new CDbCriteria(); if (!empty($tgl_awal) && empty($tgl_akhir)) { $criteria->condition = "TGL_PENGADAAN>='{$tgl_awal}'"; } else { if (empty($tgl_awal) && !empty($tgl_akhir)) { $criteria->condition = "TGL_PENGADAAN<='{$tgl_akhir}'"; } else { if (!empty($tgl_awal) && !empty($tgl_akhir)) { $criteria->condition = "TGL_PENGADAAN>='{$tgl_awal}' and TGL_PENGADAAN<='{$tgl_akhir}'"; } } } $criteria->compare('NAMA_TOKO', $toko, true); $criteria->compare('STATUS', $status); $model = Pengadaan::model()->findAll($criteria); $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); spl_autoload_register(array('YiiBase', 'autoload')); $pdf->SetCreator(PDF_CREATOR); $pdf->SetTitle("Laporan Rekap Pengadaan"); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->SetFont('helvetica', '', 8); $pdf->SetTextColor(80, 80, 80); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->AddPage(); $pdf->setJPEGQuality(75); $html = <<<EOD \t\t<h1 align="center">LAPORAN PENGADAAN</h1> \t\t<table align="left" border="1" cellpadding="2" cellspacing="0" vertical-align="middle"> \t\t\t<tbody> \t\t\t\t<tr> \t\t\t\t\t<td width="40" align="center">NO</td> \t\t\t\t\t<td width="75" align="center">Nomor PO</td> \t\t\t\t\t<td width="65" align="center">Tanggal Pengadaan</td> \t\t\t\t\t<td width="175" align="center">Permintaan</td> \t\t\t\t\t<td width="75" align="center">Nama Toko</td> \t\t\t\t\t<td width="75" align="center">Harga Total</td> \t\t\t\t\t<td width="125" align="center">Status</td> \t\t\t\t</tr> EOD; $no_urut = 0; foreach ($model as $mod) { $no_urut++; $tgl_peng = ""; if ($mod->TGL_PENGADAAN != "0000-00-00") { $tgl_peng = date("d-M-y", strtotime($mod->TGL_PENGADAAN)); } else { $tgl_peng = '-'; } $html .= <<<EOD \t\t\t\t<tr> \t\t\t\t\t<td width="40" align="center">{$no_urut}</td> \t\t\t\t\t<td width="75" align="center">{$mod->NO_PO}</td> \t\t\t\t\t<td width="65" align="center">{$tgl_peng}</td> \t\t\t\t\t<td width="175" align="center">{$mod->PERMINTAAN}</td> \t\t\t\t\t<td width="75" align="center">{$mod->NAMA_TOKO}</td> \t\t\t\t\t<td width="75" align="center">{$mod->HARGA_TOTAL}</td> \t\t\t\t\t<td width="125" align="center">{$mod->STATUS}</td> \t\t\t\t</tr> EOD; } $html .= <<<EOD \t\t\t</tbody> \t\t</table> EOD; $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); $filename = Yii::getPathOfAlias('webroot') . '/laporan/pengadaan/rekap pengadaan tanggal ' . date('d-M-y') . '.pdf'; $pdf->Output($filename, 'F'); //Yii::app()->end(); $this->redirect(Yii::app()->request->baseUrl . '/laporan/pengadaan/rekap pengadaan tanggal ' . date('d-M-y') . '.pdf'); }
</td> </tr> <tr><td colspan="2">Leyenda</td></tr> </table> EOD; $style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => false, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'helvetica', 'fontsize' => 6, 'stretchtext' => 4); $pdf = new MYPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); //----------------------------- // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(10, 19, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetAutoPageBreak(true, 0); // set auto page breaks // $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set font $pdf->SetFont('helvetica', '', 6.5); $pdf->Addpage(); $pdf->writeHTML($contenido, true, false, false, false, ''); if ($marcaAgua === '1') { // get the current page break margin $bMargin = $pdf->getBreakMargin(); // get current auto-page-break mode $auto_page_break = $pdf->getAutoPageBreak();
$this->Cell(0, 10, 'Sayfa ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M'); } } // create new PDF document $pdf = new MYPDF('L', PDF_UNIT, 'A4', true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('MYK'); $pdf->SetTitle('Tesvik Istek'); $pdf->SetSubject('Tesvik Istek'); // $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins // $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetMargins(8, 15, 8); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set default font subsetting mode $pdf->setFontSubsetting(true); // Set font // dejavusans is a UTF-8 Unicode font, if you only need to // print standard ASCII chars, you can use core fonts like // helvetica or times to reduce file size. $pdf->SetFont('DejaVuSans', '', 8, '', true); // $pdf->setLanguageArray($l); // Add a page
$pdf->SetTitle($invoicedetails[0]->title); $pdf->SetSubject('Order Invoice'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // remove default header/footer /*$pdf->setPrintHeader(false); $pdf->setPrintFooter(false);*/ // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); //set margins $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $pdf->SetMargins(0, 28.5, 0); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings $pdf->setLanguageArray($l); //-------------------------------------------------------- // set font $pdf->SetFont('helvetica', '', 12); // add a page $pdf->AddPage(); // output the HTML content $pdf->writeHTML($html, true, false, true, false, ''); //--------------//-------------------------------------------------------- $pdf->lastPage();
// Page number // Title $this->Cell(30, 0, 'Expense Report - HSU -VKU ', 0, 0, 'L', 0, ''); $this->SetFont('helvetica', 'I', 8); // Page number $this->Cell(0, 0, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'R', 0, '', 0, false, 'T', 'M'); } } // create new PDF document //$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'Letter', true, 'UTF-8', false); $pdf = new MYPDF('L', PDF_UNIT, 'Letter', true, 'UTF-8', false); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins //$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetMargins(10, 10, 10, false); //$pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font $pdf->SetFont('helvetica', '', 10); // add a page $pdf->AddPage(); // define some HTML content with style $html = <<<EOF
// set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Contract by neiroc_'); $pdf->SetTitle('PDF'); $pdf->SetSubject('PDF'); $pdf->SetKeywords('PDF'); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128)); $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128)); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, 40, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(160); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING, array(255, 64, 255), array(100, 64, 128)); $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings $pdf->setLanguageArray($l);
$stmt = "select penjualan.no_so, penjualan.tanggal_so, penjualan.no_seri_produk, penjualan.quantity, penjualan.no_nis_sales, penjualan.nama_customer, penjualan.telp_customer, produk.nama_produk, sales.nama_sales from penjualan, produk, sales where produk.no_seri = penjualan.no_seri_produk AND sales.nis = penjualan.no_nis_sales AND penjualan.cabang = '{$cabang}' AND status = 'approve' AND penjualan.tanggal_so BETWEEN '{$begin}' AND '{$end}' order by penjualan.no_nis_sales asc"; $stmt1 = "select * from cabang where kode = '{$cabang}'"; foreach (tampilData($stmt1) as $dataCabang) { } class MYPDF extends TCPDF { public function Footer() { $this->SetY(-15); $this->SetFont('helvetica', 'I', 8); $this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M'); } } $pdf = new MYPDF('L', 'mm', 'A4', true, 'UTF-8', false); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(30, 70, 20); $pdf->setPrintHeader(false); $pdf->SetAutoPageBreak(TRUE, 15); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->AddPage(); $image_file = K_PATH_IMAGES . 'luxindo.jpg'; $pdf->Image($image_file, 5, 0, 40, '', 'JPG', '', 'M', false, 300, '', false, false, 0, false, false, false); $pdf->SetFont('helvetica', 'B', 17); $pdf->setXY(45, 18, true); $pdf->Cell(0, 13, 'PT. Luxindo Raya', 0, 2, 'L', 0, '', '', 'D', 'B'); $pdf->SetFont('helvetica', 'B', 10); $pdf->setXY(45, 18, true); $pdf->Cell(0, 0, 'LAPORAN PENJUALAN', 0, 2, 'L', 0, '', ''); $pdf->SetFont('helvetica', '', 9); $pdf->Cell(0, 0, 'Cabang ' . $dataCabang['kode'] . ' - ' . $dataCabang['nama_cabang'], 0, 1, 'L', 0, ''); $pdf->Line(14, 30, 280, 30);
public function actionCreateAccount() { $params = self::accountCond(); $select1 = "OrderSN as No,CreateTime,Payment,BuyerID,RealPrice as Price,BuyerName"; $select2 = "ReturnNO as No,CreateTime,PayMethod as Payment,ServiceID as BuyerID,Price"; if ($params['type'] == 1) { $seaCon1 = "select {$select1} from pap_order t where t.Status=9"; $seaCon1 .= " and SellerID = {$params['OrganID']} and IsDelete = 0"; $seaCon1 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}"; $seaCon1 .= " order by CreateTime DESC"; $data1 = Yii::app()->papdb->createCommand($seaCon1)->queryAll(); $count1 = Yii::app()->papdb->createCommand(str_replace($select1, 'sum(RealPrice)', $seaCon1))->queryScalar(); } else { if ($params['type'] == 2) { $seaCon2 = "select {$select2} from pap_return_order t where t.Status in(4,14)"; $seaCon2 .= " and DealerID = {$params['OrganID']}"; $seaCon2 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}"; $seaCon2 .= " order by CreateTime DESC"; $data2 = Yii::app()->papdb->createCommand($seaCon2)->queryAll(); $count2 = Yii::app()->papdb->createCommand(str_replace($select2, 'sum(Price)', $seaCon2))->queryScalar(); } else { $seaCon1 = "select {$select1} from pap_order t where t.Status=9"; $seaCon1 .= " and SellerID = {$params['OrganID']} and IsDelete = 0"; $seaCon1 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}"; $seaCon1 .= " order by CreateTime DESC"; $data1 = Yii::app()->papdb->createCommand($seaCon1)->queryAll(); $count1 = Yii::app()->papdb->createCommand(str_replace($select1, 'sum(RealPrice)', $seaCon1))->queryScalar(); $seaCon2 = "select {$select2} from pap_return_order t where t.Status in(4,14)"; $seaCon2 .= " and DealerID = {$params['OrganID']}"; $seaCon2 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}"; $seaCon2 .= " order by CreateTime DESC"; $data2 = Yii::app()->papdb->createCommand($seaCon2)->queryAll(); $count2 = Yii::app()->papdb->createCommand(str_replace($select2, 'sum(Price)', $seaCon2))->queryScalar(); } } $count1 = $count1 ? $count1 : 0; $count2 = $count2 ? $count2 : 0; $gain = $count1 - $count2; $day = date('t', $params['starttime']); $organ = Organ::model()->findByPk($params['OrganID'], array('select' => 'OrganName'))->attributes; $html = '<div style="height:24px; line-height:24px; background-color:#1f76c8"> <div style="margin:0 auto; text-align:center"> <span style="font-family:微软雅黑; font-size:24px; color:#fff; word-spacing:8px; letter-spacing: 1.5px;">' . $params['uyear'] . '年' . $params['umonth'] . '月对账单</span> </div> </div> <div style="font-size:16px; color:#343434; line-height:16px"> <p style="margin:0px; ">亲爱的' . $organ['OrganName'] . ',您好!</p> <p style="margin:0px; ">感谢您使用由你配平台,以下是您' . $params['umonth'] . '月的平台交易明细:</p> </div> <div style="height:20px; line-height:18px; border-bottom:2px solid #c9c7c7; border-top:2px solid #c9c7c7; background-color:#f2f2f2; padding:0 30px"> <div style="font-size:16px; font-weight:bold; color:#565656; line-height:18px;float:left"> 本月净收益: <span style="color:#1f76c8">' . $gain . '</span> 元 </div> <div style="font-size:16px; line-height:18px;float:right"> <p style="margin:0px; line-height:15px"> 本月总收入: <span style="color:#1f76c8;font-size:14px">' . $count1 . '</span>元 本月总支出: <span style="color:#1f76c8;font-size:14px">' . $count2 . '</span>元</p> <p style="margin:0px; line-height:15px"> 账单周期:' . $params['uyear'] . '年' . $params['umonth'] . '月01日—' . $params['uyear'] . '年' . $params['umonth'] . '月' . $day . '日 </p> </div> </div>'; Yii::import('application.extensions.tcpdf.*'); // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // 设置文档信息 $pdf->SetCreator('--'); $pdf->SetAuthor('北京嘉配科技有限公司'); $pdf->SetTitle('由你配 - 对账单'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, PHP'); // 设置页眉和页脚信恿 $pdf->SetHeaderData('', 30, '', '', array(0, 64, 255), array(0, 64, 128)); $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128)); // 设置页眉和页脚字使 $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // 设置默认等宽字体 $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // 设置间距 $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // 设置分页 $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // 设置字体 $pdf->SetFont('stsongstdlight', '', 14, true); // 添加页面 $pdf->AddPage(); // Image example with resizing $pdf->Image(F::themeUrl() . '/images/jpd/logo_account.jpg', 20, 28, 30, 18, 'JPG', '', '', true, 150, '', false, false, 0, false, false, false); // 设置字体阴影 //$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal')); // 输出HTML内容 $pdf->writeHTML($html, true, false, true, false, ''); if (!empty($data1)) { $html = '<p style="color:#1f76c8">订单明细:</p>'; $pdf->writeHTML($html, true, false, true, false, ''); // 表格标题 $header = array('时间', '交易类型', '修理厂名称', '订单编号', '收入(元)'); // data loading $data = array(); foreach ($data1 as $key => $val) { $data[$key][0] = date('Y-m-d', $val['CreateTime']); $data[$key][1] = $val['Payment'] == 2 ? '物流代收款' : '支付宝担保'; if (!$val['BuyerName']) { $val['BuyerName'] = Organ::model()->findByPk($val['BuyerID'], array('select' => 'OrganName'))->attributes['OrganName']; } $data[$key][2] = $val['BuyerName']; $data[$key][3] = $val['No']; $data[$key][4] = $val['Price']; } // 输出表格 $pdf->ColoredTable($header, $data); //换行 $pdf->Ln(); } if (!empty($data2)) { $html = '<p style="color:#1f76c8;">退货明细:</p>'; $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); // 表格标题 $header = array('时间', '退款方式', '修理厂名称', '退货单号', '支出(元)'); // 导入数据 $data = array(); foreach ($data2 as $key => $val) { $data[$key][0] = date('Y-m-d', $val['CreateTime']); $data[$key][1] = $val['Payment'] == 1 ? '物流代收款' : '支付宝担保'; $data[$key][2] = Organ::model()->findByPk($val['BuyerID'], array('select' => 'OrganName'))->attributes['OrganName']; $data[$key][3] = $val['No']; $data[$key][4] = $val['Price']; } // 输出表格 $pdf->ColoredTable($header, $data); } $pdf->Output('Account.pdf', 'I'); }
function generatePdfReport($pdfData, $mode, $params, $fileName) { $countries = CJFunctions::get_country_names(); $responses = array(); $include_email_in_reports = $params->get('include_email_in_reports', 0); foreach ($pdfData->responses as $response) { $responses[$response->id] = new stdClass(); $responses[$response->id]->created_by = $response->created_by; $responses[$response->id]->created = $response->created; $responses[$response->id]->username = $response->username; $responses[$response->id]->name = $response->name; if ($include_email_in_reports == 1) { $responses[$response->id]->email = $response->email; } $responses[$response->id]->questions = array(); foreach ($pdfData->questions as $question) { $responses[$response->id]->questions[$question->id] = new stdClass(); $responses[$response->id]->questions[$question->id]->answer = ''; $responses[$response->id]->questions[$question->id]->question_type = $question->question_type; } } if (!empty($pdfData->entries)) { foreach ($pdfData->entries as $entry) { if (isset($responses[$entry->response_id]) && isset($responses[$entry->response_id]->questions[$entry->question_id])) { if (!empty($entry->answer)) { if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) { $responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->answer; } else { $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->answer; } if (!empty($entry->answer_image) && JFile::exists(S_IMAGES_UPLOAD_DIR . '/' . $entry->answer_image)) { //$image = JHtml::image(JURI::root(true).'/media/communitysurveys/images/'.$entry->answer_image, $entry->answer); $image = '<img src="' . JURI::root(true) . '/media/communitysurveys/images/' . $entry->answer_image . '">'; $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $image; } } if (!empty($entry->answer2)) { if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) { $responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->answer2; } else { $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->answer2; } } if (!empty($entry->free_text)) { // do special types formatting // if ($responses[$entry->response_id]->questions[$entry->question_id]->question_type == S_SPECIAL_NAME) { $names = explode('|', $entry->free_text); if (!empty($names)) { $entry->free_text = $names[0] . '. ' . $names[1] . ' ' . $names[2]; } else { $entry->free_text = ''; } } else { if ($responses[$entry->response_id]->questions[$entry->question_id]->question_type == S_SPECIAL_ADDRESS) { $parts = explode('|||', $entry->free_text); if (count($parts) == 7) { $entry->free_text = '<address><strong>' . CJFunctions::escape($parts[0]) . '</strong><br>'; $entry->free_text .= CJFunctions::escape($parts[1]) . '<br>'; if (!empty($parts[2])) { $entry->free_text .= CJFunctions::escape($parts[2]) . '<br>'; } $entry->free_text .= CJFunctions::escape($parts[3]) . ', ' . CJFunctions::escape($parts[4]) . ', ' . CJFunctions::escape($parts[6]) . '<br>'; $entry->free_text .= !empty($countries[$parts[5]]) ? $countries[$parts[5]]->country_name : CJFunctions::escape($parts[5]); } else { $entry->free_text = ''; } } } // do special types formatting // if (empty($responses[$entry->response_id]->questions[$entry->question_id]->answer)) { $responses[$entry->response_id]->questions[$entry->question_id]->answer = $entry->free_text; } else { $responses[$entry->response_id]->questions[$entry->question_id]->answer .= '<br/>' . $entry->free_text; } } } } } $response_rows = array(); foreach ($responses as $id => $response) { $string = '<table class="table table-striped" width="100%">'; $string = $string . '<tr><th width="30%"><strong>Response ID:</strong></th><td width="70%">' . $id . '</td></tr>'; $string = $string . '<tr><th><strong>Response Date:</strong></th><td>' . $response->created . '</td></tr>'; $string = $string . '<tr><th><strong>User ID:</strong></th><td>' . $response->created_by . '</td></tr>'; $string = $string . '<tr><th><strong>Username:</strong></th><td>' . $response->username . '</td></tr>'; $string = $string . '<tr><th><strong>User Display Name:</strong></th><td>' . $response->name . '</td></tr>'; if ($include_email_in_reports == 1) { $string = $string . '<tr><td><strong>Email:</strong></td><td>' . $response->email . '</td></tr>'; } foreach ($pdfData->questions as $question) { $string = $string . '<tr><td colspan="2"> <hr></td></tr>'; $string = $string . '<tr><th colspan="2"><h3>' . $question->title . '</h3></th></tr>'; if (!empty($question->description)) { $string = $string . '<tr><td colspan="2">' . $question->description . '</td></tr>'; } $string = $string . '<tr><td colspan="2"> </td></tr>'; $string = $string . '<tr><td colspan="2">' . $response->questions[$question->id]->answer . '</td></tr>'; } $string = $string . '</table>'; array_push($response_rows, $string); } // create new PDF document require_once JPATH_COMPONENT_SITE . '/helpers/tcpdf.php'; $pdf = new MYPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set default header data $pdf->SetHeaderData('logo.png', PDF_HEADER_LOGO_WIDTH, $pdfData->title, ''); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('corejoomla.com'); $pdf->SetTitle('Survey Report'); $pdf->SetSubject('Survey Responses Report'); $pdf->SetKeywords('survey, report'); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // --------------------------------------------------------- // set font $pdf->SetFont('freesans'); foreach ($response_rows as $i => $response) { $pdf->AddPage(); $pdf->writeHTML($response, true, false, true, false, ''); $pdf->lastPage(); } $pdf->Output($fileName, $mode); }
$this->Ln(6); $this->SetFont('times'); $this->SetFontSize(11.0); $this->Cell(0, 0, 'Kampus Universitas Negeri Jakarta, Jalan Rawamangun Muka, Jakarta 13220', 0, false, 'C', 0, '', 0, false, 'M', 'M'); $this->Ln(5); $this->SetFont('times'); $this->SetFontSize(10.0); $this->Cell(0, 0, 'Telepon/Faximile : Rektor: (021)4893854, PR I : 4895130, PR II : 4893918, PR III : 4892926, PR IV : 4893982', 0, false, 'C', 0, '', 0, false, 'M', 'M'); $this->Ln(5); $this->SetFont('times'); $this->SetFontSize(10.0); $this->Cell(0, 0, 'BAUK : 4750930, BAAK : 4759081, BAPSI : 4752180', 0, false, 'C', 0, '', 0, false, 'M', 'M'); $this->Ln(4); $this->SetFont('times'); $this->SetFontSize(9.199999999999999); $this->Cell(0, 0, 'Bagian UHTP: Telepon: 4893726, Bagian Keuangan : 4892414, Bagian Kepegawaian : 4890536, Bagian HUMAS : 4898486', 0, false, 'C', 0, '', 0, false, 'M', 'M'); $this->Ln(4); $this->SetFont('times'); $this->SetFontSize(10); $this->Cell(0, 0, 'Laman : www.unj.ac.id', 0, false, 'C', 0, '', 0, false, 'M', 'M'); $this->Ln(1); $this->SetFont('timesB'); $this->SetFontSize(19); $this->Cell(0, 0, '_________________________________________________', 0, false, 'C', 0, '', 0, false, 'M', 'M'); //$this->Cell($w, $h, $txt, $border, $ln, $align, $fill, $link, $stretch, $ignore_min_height, $calign); } } $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->setHeaderMargin(10); $pdf->SetMargins(17, 60, 0);
function checkStoreInvoice($orderDetails = 0) { JRequest::setVar('task', 'checkStoreInvoice'); $force = true; // @ini_set( 'max_execution_time', 5 ); $path = VmConfig::get('forSale_path', 0); if ($path === 0) { vmError('No path set to store invoices'); return false; } else { $path .= 'invoices' . DS; if (!file_exists($path)) { vmError('Path wrong to store invoices, folder invoices does not exist ' . $path); return false; } else { if (!is_writable($path)) { vmError('Cannot store pdf, directory not writeable ' . $path); return false; } } } $orderModel = VmModel::getModel('orders'); $invoiceNumberDate = array(); if (!$orderModel->createInvoiceNumber($orderDetails['details']['BT'], $invoiceNumberDate)) { return 0; } if (!empty($invoiceNumberDate[0])) { $invoiceNumber = $invoiceNumberDate[0]; } else { $invoiceNumber = FALSE; } if (!$invoiceNumber or empty($invoiceNumber)) { vmError('Cant create pdf, createInvoiceNumber failed'); return 0; } if (shopFunctions::InvoiceNumberReserved($invoiceNumber)) { return 0; } $path .= 'vminvoice_' . $invoiceNumber . '.pdf'; if (file_exists($path) and !$force) { return $path; } // $app = JFactory::getApplication('site'); //We come from the be, so we need to load the FE langauge $jlang = JFactory::getLanguage(); $jlang->load('com_virtuemart', JPATH_SITE, 'en-GB', true); $jlang->load('com_virtuemart', JPATH_SITE, $jlang->getDefault(), true); $jlang->load('com_virtuemart', JPATH_SITE, null, true); $this->addViewPath(JPATH_VM_SITE . DS . 'views'); $format = 'html'; $viewName = 'invoice'; $view = $this->getView($viewName, $format); $view->addTemplatePath(JPATH_VM_SITE . DS . 'views' . DS . 'invoice' . DS . 'tmpl'); $view->invoiceNumber = $invoiceNumberDate[0]; $view->invoiceDate = $invoiceNumberDate[1]; $view->orderDetails = $orderDetails; $view->uselayout = 'invoice'; ob_start(); $view->display(); $html = ob_get_contents(); ob_end_clean(); // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator('Invoice by VirtueMart 2, used library tcpdf'); $pdf->SetAuthor($view->vendor->vendor_name); $pdf->SetTitle(JText::_('COM_VIRTUEMART_INVOICE_TITLE')); $pdf->SetSubject(JText::sprintf('COM_VIRTUEMART_INVOICE_SUBJ', $view->vendor->vendor_store_name)); $pdf->SetKeywords('Invoice by VirtueMart 2'); //virtuemart.cloudaccess.net/index.php?option=com_virtuemart&view=invoice&layout=details&virtuemart_order_id=18&order_number=6e074d9b&order_pass=p_9cb9e2&task=checkStoreInvoice if (empty($view->vendor->images[0])) { vmError('Vendor image given path empty '); } else { if (empty($view->vendor->images[0]->file_url_folder) or empty($view->vendor->images[0]->file_name) or empty($view->vendor->images[0]->file_extension)) { vmError('Vendor image given image is not complete ' . $view->vendor->images[0]->file_url_folder . $view->vendor->images[0]->file_name . '.' . $view->vendor->images[0]->file_extension); vmdebug('Vendor image given image is not complete, the given media', $view->vendor->images[0]); } else { if (!empty($view->vendor->images[0]->file_extension) and strtolower($view->vendor->images[0]->file_extension) == 'png') { vmError('Warning extension of the image is a png, tpcdf has problems with that in the header, choose a jpg or gif'); } else { $imagePath = DS . str_replace('/', DS, $view->vendor->images[0]->file_url_folder . $view->vendor->images[0]->file_name . '.' . $view->vendor->images[0]->file_extension); if (!file_exists(JPATH_ROOT . $imagePath)) { vmError('Vendor image missing ' . $imagePath); } else { $pdf->SetHeaderData($imagePath, 60, $view->vendor->vendor_store_name, $view->vendorAddress); } } } } // set header and footer fonts $pdf->setHeaderFont(array('helvetica', '', 8)); $pdf->setFooterFont(array('helvetica', '', 10)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //TODO include the right file (in libraries/tcpdf/config/lang set some language-dependent strings $l = ''; $pdf->setLanguageArray($l); // set default font subsetting mode $pdf->setFontSubsetting(true); // Set font // dejavusans is a UTF-8 Unicode font, if you only need to // print standard ASCII chars, you can use core fonts like // helvetica or times to reduce file size. $pdf->SetFont('helvetica', '', 8, '', true); // Add a page // This method has several options, check the source code documentation for more information. $pdf->AddPage(); // Set some content to print // $html = // Print text using writeHTMLCell() $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); // Close and output PDF document // This method has several options, check the source code documentation for more information. $pdf->Output($path, 'F'); return $path; }
// Set font $this->SetFont('helvetica', 'I', 8); // Page number $this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M'); } } // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Roy'); $pdf->SetTitle('Factura'); $pdf->SetSubject('Primera Factura'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // set margins $pdf->SetMargins(5, PDF_MARGIN_TOP, 9); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set some language-dependent strings (optional) if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) { require_once dirname(__FILE__) . '/lang/eng.php'; $pdf->setLanguageArray($l); } // --------------------------------------------------------- // set font $pdf->SetFont('times', 'B', 11); $nit = 7024739019; $nfac = 01; $nauto = 1234567890123;
$this->Cell(0, 3, mb_strtoupper(api_text("module-diary_export-footer"), 'UTF-8') . " " . $training->datetraining, 0, 0, 'R', 0); //$this->Cell(0,3,mb_strtoupper(api_text("module-diary_export-footer"),'UTF-8')." ".$GLOBALS['module-diary']->number,0,0,'R',0); } } // create new pdf document $pdf = new MYPDF('L', 'mm', 'A4', true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); //$pdf->SetAuthor(api_account($training->addIdAccount)->name); $pdf->SetTitle("Dettaglio allenamenti svolti"); //$pdf->SetSubject("Training nr. ".$training->number." - ".api_timestampFormat($request->timestamp,api_text("date"))); // header and footer $pdf->setPrintHeader(true); $pdf->setPrintFooter(true); // set margins $pdf->SetMargins(10, 30, 10); $pdf->SetHeaderMargin(30); $pdf->SetFooterMargin(10); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, 15); // set font $pdf->SetFont('freesans', '', 12, '', true); // add a page $pdf->AddPage(); // page styles $pdf->SetTextColor(0); $pdf->SetFillColor(245); $fill = FALSE; // border $border = ''; // header
// Set font $this->SetFont('times', 'I', 8); // Page number $this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M'); } } // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Roy'); $pdf->SetTitle('Factura'); $pdf->SetSubject('Primera Factura'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // set margins $pdf->SetMargins(15, PDF_MARGIN_TOP, 15); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set some language-dependent strings (optional) if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) { require_once dirname(__FILE__) . '/lang/eng.php'; $pdf->setLanguageArray($l); } // --------------------------------------------------------- // set font $pdf->SetFont('times', 'B', 11); $nit = 7024739019; $nfac = 01; $nauto = 1234567890123;
$this->Cell(array_sum($w), 0, '', 'T'); } } $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_INVOICE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Pharm Sys'); $pdf->SetTitle('Receipt'); $pdf->SetSubject('Payment'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); //$pdf->SetHeaderData(PDF_RECEIPT_LOGO, PDF_RECEIPT_LOGO_WIDTH, PDF_RECEIPT_TITLE, PDF_HEADER_STRING, array(0,0,0), array(0,0,0)); //$pdf->setHeaderFont(Array(PDF_FONT_NAME_RECEIPT, '', PDF_FONT_SIZE_RECEIPT)); //$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(PDF_INVOICE_LEFT, PDF_INVOICE_TOP, PDF_INVOICE_RIGHT); $pdf->SetHeaderMargin(PDF_INVOICE_HEADER); $pdf->SetFooterMargin(PDF_INVOICE_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_INVOICE_BOTTOM); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->setLanguageArray($l); $pdf->SetFont('times', '', 10, '', true); $pdf->AddPage(); $spacing = -0.01; $stretching = 75; $pdf->setFontStretching($stretching); $pdf->setFontSpacing($spacing); $titling = <<<EOD <strong> <font style="font-size:11">Pharmacy Sys</font> </strong> <br> <strong>Official Receipt</strong><br> Student Center Ground Floor,<br> P.O. Box Private Bag Kabarak, Kenya <br> Tel: +254 702 937 925 <br> E-mail: pharmacysys@yahoo.com <br>-----------------------------------------
public function generarReporte($atributosReceta, $labelCabecera, $labelDetalle, $labelPie, $datosCabecera, $datosDetalle, $datosExamen, $datosExamenUni, $datosGrupo, $datosPie, $modo, $nombreReceta, $parametros) { $lblCabecera = array(); $lblDetalle = array(); $lblPie = array(); $styleCL = array(); $styleCD = array(); $styleDL = array(); $styleDD = array(); $stylePL = array(); $stylePD = array(); $o_classGeneral = new classGeneral(); $o_classGeneral->setLabelCabecera($labelCabecera, $atributosReceta); $styleCL = $o_classGeneral->getStyleCL(); $styleCD = $o_classGeneral->getStyleCD(); $lblCabecera = $o_classGeneral->getLblCabecera(); $o_classGeneral->setLabelDetalle($labelDetalle, $atributosReceta); $styleDL = $o_classGeneral->getStyleDL(); $styleDD = $o_classGeneral->getStyleDD(); $lblDetalle = $o_classGeneral->getLblDetalle(); $o_classGeneral->setLabelPie($labelPie, $atributosReceta); $stylePL = $o_classGeneral->getStylePL(); $stylePD = $o_classGeneral->getStylePD(); $lblPie = $o_classGeneral->getLblPie(); $pdf = new MYPDF($parametros["PDF_PAGE_ORIENTATION"], PDF_UNIT, $parametros["PDF_PAGE_FORMAT"], true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Juan Carlos Ludeña Montesinos'); $pdf->SetTitle('Generardor de Reportes'); $pdf->SetSubject('Generardor de Reportes'); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->setPrintHeader($parametros["PRINT_HEADER"]); $pdf->setPrintFooter($parametros["PRINT_FOOTER"]); $pdf->SetMargins($parametros["PDF_MARGIN_LEFT"], $parametros["PDF_MARGIN_TOP"], $parametros["PDF_MARGIN_RIGHT"]); $pdf->SetHeaderMargin($parametros["PDF_MARGIN_HEADER"]); $pdf->SetFooterMargin($parametros["PDF_MARGIN_FOOTER"]); $pdf->SetAutoPageBreak($parametros["AUTO_PAGE_BREAK"], $parametros["PDF_MARGIN_BOTTOM"]); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->SetFont('helvetica', '', 6); $pdf->AddPage(); $style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => false, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => false, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4); $pdf->write1DBarcode($parametros["CODIGO_DE_BARRAS"], 'C39', 75, 278, 70, 8, 0.4, $style, 'N'); $pdf->CargarDatos($lblCabecera, $lblDetalle, $lblPie, $datosCabecera, $datosDetalle, $datosExamen, $datosExamenUni, $datosGrupo, $datosPie, $styleCL, $styleDL, $stylePL, $styleCD, $styleDD, $stylePD, $modo); $pdf->lastPage(); $pdf->Output($nombreReceta, 'I'); }
$stmt2 = "select sum(komisi) as total from komisi where cabang = '{$cabang}' AND tanggal_so BETWEEN '{$begin}' AND '{$end}'"; $stmt1 = "select * from cabang where kode = '{$cabang}'"; foreach (tampilData($stmt1) as $dataCabang) { } class MYPDF extends TCPDF { public function Footer() { $this->SetY(-15); $this->SetFont('helvetica', 'I', 8); $this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M'); } } $pdf = new MYPDF('P', 'mm', 'A4', true, 'UTF-8', false); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->SetMargins(15, 10, 15); $pdf->setPrintHeader(false); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->AddPage(); foreach (tampilData($stmt) as $grid) { $pdf->SetFont('helvetica', 'B', 9); $pdf->setXY(15, $pdf->getY(), true); $pdf->Cell(0, 0, 'SLIP KOMISI SALES', 0, 2, 'C', 0, '', ''); $pdf->SetFont('helvetica', '', 7); $pdf->setXY(15, $pdf->getY(), true); $pdf->Cell(0, 0, 'PT. LUXINDO RAYA', 0, 2, 'C', 0, '', ''); $pdf->SetFont('helvetica', 'B', 7); $pdf->setXY(15, $pdf->getY(), true); $pdf->MultiCell(15, 7, "NIS", 0, 'L', false, 0, '', '', false, 0, false, false, 7, 'M'); $pdf->MultiCell(5, 7, ":", 0, 'L', false, 0, '', '', false, 0, false, false, '', 'M'); $pdf->MultiCell(100, 7, $grid['nis'], 0, 'L', false, 0, '', '', false, 0, false, false, '', 'M');
include_once 'rpt_logos_encabezado.php'; // create new PDF $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, "LETTER", true, 'UTF-8', false); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); //----------------------------- // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(15, 30, 15); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set font $pdf->SetFont('helvetica', '', 9); # creamos una página en blanco $pdf->Addpage(); $pdf->SetFont('helvetica', '', 9); // define barcode style $style = array('position' => 'R', 'align' => 'C', 'stretch' => 0, 'fitwidth' => 1, 'cellfitalign' => '', 'border' => 1, 'hpadding' => '2', 'vpadding' => '2', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'Helvetica', 'fontsize' => 6, 'stretchtext' => 4); $styleBC = array('position' => 'R', 'border' => 1, 'padding' => 2, 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 255), 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4); $estilo_tabla = "<style>\r\n .tablaFicha{\r\n width: 100%;\r\n font-size: 10px; \r\n }\r\n .celdaTablaFicha{\r\n border: 1px solid #CCCCCC;\r\n vertical-align: middle;\r\n }\r\n .fecha{\r\n text-align: right;\r\n }\r\n .encabezado{\r\n background-color: #EFEFEF;\r\n }\r\n</style>";
} // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Rafael Kueng'); $pdf->SetTitle('LISA Symposium 2016 Attendance Letter'); $pdf->SetSubject('LISA Symposium 2016 Attendance Letter'); $pdf->SetKeywords('LISA,Symposium,2016,attendance'); // set header and footer fonts $pdf->setHeaderFont(array("helvetica", '', "12")); $pdf->setFooterFont(array("helvetica", '', "12")); // set default monospaced font $pdf->SetDefaultMonospacedFont("courier"); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // --------------------------------------------------------- $LM = $pdf->getMargins()['left']; $RM = $pdf->getMargins()['right']; $W = $pdf->getPageWidth() - $RM - $LM; // --------------------------------------------------------- $pdf->SetFont('helvetica', '', 12); $pdf->AddPage(); // Print address $pdf->SetFont('helvetica', '', 10);
function dispNstore_digitalCertificate() { $oNstore_digitalModel = getModel('nstore_digital'); $logged_info = Context::get('logged_info'); $cart_srl = Context::get('cart_srl'); if (!Context::get('is_logged')) { return new Object(-1, 'msg_login_required'); } $config = $oNstore_digitalModel->getModuleConfig(); $item_info = $oNstore_digitalModel->getPurchasedItem($logged_info->member_srl, $cart_srl); Context::set('item_info', $item_info); if (!in_array($item_info->order_status, array('3'))) { return new Object(-1, '구매완료된 상품이 아닙니다.'); } // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Nicola Asuni'); $pdf->SetTitle('TCPDF Example 006'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); /* // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING); */ // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); //$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // remove default header/footer //$pdf->setPrintHeader(false); $pdf->setPrintFooter(false); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); //set auto page breaks //$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font //$pdf->SetFont('dejavusans', '', 10); $pdf->SetFont('cid0kr', '', 16); // table line height //$pdf->setCellHeightRatio(1.9); $pdf->setCellHeightRatio(1.7); // add a page $pdf->AddPage(); // output the HTML content $this->setTemplatePath($this->module_path . "tpl"); $oTemplate =& TemplateHandler::getInstance(); $output = $oTemplate->compile($this->module_path . 'tpl', 'certificate'); $pdf->writeHTML($output, true, false, true, false, ''); // reset pointer to the last page $pdf->lastPage(); //Close and output PDF document $pdf->Output('certificate.pdf', 'I'); exit; }