本文整理汇总了PHP中Pdf::SetAuthor方法的典型用法代码示例。如果您正苦于以下问题:PHP Pdf::SetAuthor方法的具体用法?PHP Pdf::SetAuthor怎么用?PHP Pdf::SetAuthor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pdf
的用法示例。
在下文中一共展示了Pdf::SetAuthor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GeneraPdf
public function GeneraPdf($html, $nombre)
{
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('');
$pdf->SetTitle('');
$pdf->SetSubject('');
$pdf->SetKeywords('');
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . '', PDF_HEADER_STRING, array(255, 255, 255), array(255, 255, 255));
$pdf->SetFooterData($tc = array(0, 64, 0), $lc = array(255, 255, 255));
$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);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('helvetica', '', 10, '', true);
$pdf->AddPage();
$pdf->writeHTML($html, true, false, true, false, '');
$nombre_archivo = utf8_decode($nombre . date('Y-m-d-His') . ".pdf");
$pdf->Output($nombre_archivo, 'I');
}
示例2: reporte_medicamentos
/** @Functions que permiten generar PDF's con reportes
/**************************************************************************/
public function reporte_medicamentos()
{
// Carga de datos
$data_meds = $this->gestion->get_medicamentos();
$tmp_meds = $this->templates->tmp_reporte_medicamentos($data_meds);
// Generacion de PDF
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Sysmedcloud');
$pdf->SetTitle('Reporte de Medicamentos');
$pdf->SetSubject('');
$pdf->SetKeywords('');
$pdf->SetHeaderData('logo.png', PDF_HEADER_LOGO_WIDTH + 20, 'Reporte', 'Medicamentos', array(0, 64, 255), array(0, 64, 128));
$pdf->setFooterData($tc = array(0, 64, 0), $lc = 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);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('Helvetica', '', 8, '', true);
$pdf->AddPage();
$pdf->writeHTML($tmp_meds, true, 0, true, 0);
$nombre_archivo = utf8_decode("reporte-medicamentos-" . date("d") . "_" . date("m") . "_" . date("Y") . ".pdf");
$pdf->Output($nombre_archivo, 'I');
}
示例3: index
function index()
{
$this->load->library('Pdf');
$userdata = $this->session->all_userdata();
$data['email'] = $userdata['email'];
$this->load->model('tenants_model');
$data['tenant_detail'] = $this->tenants_model->get_unit($data['email']);
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetTitle('Rent Receipt');
$pdf->SetHeaderMargin(30);
$pdf->SetTopMargin(20);
$pdf->setFooterMargin(20);
$pdf->SetAutoPageBreak(true);
$pdf->SetAuthor('Rentit Agency');
$pdf->SetDisplayMode('real', 'default');
$pdf->AddPage();
$html = <<<EOD
<table cellspacing="3" cellpadding="6" border="">
\t\t
\t\t
EOD;
$pdf->Ln();
$html .= "<tr><td>";
$html .= "<b>RENTIT AGENCY<br />RENT RECEIPT</b>";
$html .= "</td><td>";
$this->load->helper('date');
$datestring = "%Y-%m-%d ";
$date = mdate($datestring);
$html .= "<b>Date Received: </b> {$date} <br />";
$html .= "<br /><b>Received From: </b> ";
$html .= $userdata['email'];
'<br />';
$html .= "<br /><br/><b>The sum of: </b> KeS ";
$html .= $userdata['amount'];
'<br />';
$html .= "</td></tr>";
$html .= "<tr><td colspan=2>";
$html .= "<b>For Rent at:</b> ";
$html .= $data['tenant_detail'][0]['block_name'];
$html .= " house, ";
$html .= $data['tenant_detail'][0]['unitname'];
',';
$html .= "<br /><br /><b>Rent Period Starting</b>: ";
$html .= $data['tenant_detail'][0]['occupation_date'];
',<br />';
$html .= "<br /><br /><b>Received by: </b> Rentit Agency";
$html .= "</td></tr>";
$html .= "</table>";
$pdf->writeHTML($html, true, false, false, false, '');
ob_clean();
$pdf->Output('Receipt.pdf', 'I');
}
示例4: generar
public function generar($code)
{
$this->load->library('Pdf');
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
// $pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Espacio Vivo');
// $pdf->SetTitle('Ejemplo de provincías con TCPDF');
// $pdf->SetSubject('Tutorial TCPDF');
$pdf->SetKeywords('espacio vivo, inmuebles, pdf, PDF, renta');
// datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config_alt.php de libraries/config
// $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 001', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));
$pdf->setFooterData($tc = array(0, 64, 0), $lc = array(0, 64, 128));
// datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config.php de libraries/config
// $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
// $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
// $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//relación utilizada para ajustar la conversión de los píxeles
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// ---------------------------------------------------------
// establecer el modo de fuente por defecto
$pdf->setFontSubsetting(true);
// Establecer el tipo de letra
//Si tienes que imprimir carácteres ASCII estándar, puede utilizar las fuentes básicas como
// Helvetica para reducir el tamaño del archivo.
$pdf->SetFont('helvetica', '', 14, '', false);
// Añadir una página
// Este método tiene varias opciones, consulta la documentación para más información.
$pdf->AddPage();
//fijar efecto de sombra en el texto
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
// Establecemos el contenido para imprimir
$immovable = $this->general->bringme_immovable($code);
$immovable = $immovable[0];
$html = $this->load->view("pdf", $immovable, true);
// Imprimimos el texto con writeHTMLCell()
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
// ---------------------------------------------------------
// Cerrar el documento PDF y preparamos la salida
// Este método tiene varias opciones, consulte la documentación para más información.
$nombre_archivo = utf8_decode("Inmueble" . $immovable['code'] . ".pdf");
$pdf->Output($nombre_archivo, 'I');
}
示例5: print_brgy_leaders
public function print_brgy_leaders($voter_data = array(), $data = array())
{
$this->load->library('pdf');
$pdf = new Pdf('L', 'mm', 'LETTER', true, 'UTF-8', false);
$pdf->SetTitle('My Title');
$pdf->SetHeaderMargin(30);
$pdf->SetTopMargin(20);
$pdf->setFooterMargin(10);
$pdf->SetAutoPageBreak(true, 15);
$pdf->SetAuthor('Author');
$pdf->AddPage('L', 'LEGAL');
$pdf->setY(30);
$html = '';
$html .= '<div style="text-align: center;"><b>Brgy Leaders</b> for<br/><b>' . $data['brgy'] . '</b></div>';
$html .= '<br/>';
$html .= '<br/>';
$html .= '<table style="border: 1px solid #000;border-collapse: collapse;" border="1" cellspacing="0" cellpadding="1">';
$html .= '<thead>';
$html .= '<tr style="background-color: #a8a8a8;">';
$html .= '<th align="center" width="5%"></th>';
$html .= '<th align="center" width="45%"><b>Voter\'s Name</b></th>';
$html .= '<th align="center" width="30%"><b>Precinct No</b></th>';
$html .= '<th align="center" width="20%"><b>Type</b></th>';
$html .= '</tr>';
$html .= '</thead>';
if (count($voter_data) > 0) {
$x = 1;
foreach ($voter_data as $type => $val) {
for ($ctr = 0; $ctr < count($val); $ctr++) {
$html .= '<tr nobr="true">';
$html .= '<td align="center" width="5%">' . $x . '.</td>';
$html .= '<td width="45%"> ' . $val[$ctr]['full_name'] . '</td>';
$html .= '<td width="30%"> ' . $val[$ctr]['precinct_no'] . '</td>';
$html .= '<td width="20%"> ' . $val[$ctr]['type'] . '</td>';
$html .= '</tr>';
$x++;
}
}
} else {
$html .= '<tr>';
$html .= '<td align="center" width="100%">No record found..</td>';
$html .= '</tr>';
}
$html .= '</table>';
$pdf->writeHTML($html, true, false, false, false, '');
$pdf->Output('brgy_leaders_report.pdf', 'I');
}
示例6: index
public function index()
{
if (strlen($this->getParam()) == 0) {
App::redirectUrl($this->registry->router->generate('frontend.home', true));
}
$product = App::getModel('product/product')->getProductAndAttributesById((int) $this->registry->core->getParam());
$range = App::getModel('product/product')->getRangeType((int) $this->registry->core->getParam());
App::getModel('product/product')->getPhotos($product);
if (empty($product)) {
App::redirectUrl($this->registry->router->generate('frontend.home', true));
}
$product['photo']['normal'][0] = 'design/' . str_replace(DESIGNPATH, '', $product['photo']['normal'][0]);
$selectAttributes = App::getModel('product/product')->getProductAttributeGroups($product);
$attset = App::getModel('product/product')->getProductVariant($product);
$this->registry->template->assign('product', $product);
$this->registry->template->assign('attributes', $selectAttributes);
$this->registry->template->assign('attset', $attset);
$this->registry->template->assign('ROOTPATH', ROOTPATH);
$htmlcontent = $this->registry->template->fetch($this->loadTemplate('index.tpl'));
$pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Gekosale');
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
$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);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setLanguageArray(1);
$pdf->SetFont('dejavusans', '', 10);
$pdf->AddPage();
$pdf->writeHTML($htmlcontent, true, 0, true, 0);
@ob_clean();
$pdf->Output($product['seo'], 'D');
}
示例7: tiparire
function tiparire($fromDate, $toDate)
{
$this->load->model('cerere_model');
$filtru = array('fromDate' => $fromDate, 'toDate' => $toDate);
$cereri = $this->cerere_model->getCereriAll($filtru);
$this->load->library('Pdf');
$pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetTitle('Cereri');
$pdf->SetTopMargin(5);
$pdf->setFooterMargin(5);
$pdf->SetAutoPageBreak(true);
$pdf->SetAuthor('poartacerului.ro');
$pdf->SetDisplayMode('real', 'default');
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$output = "<strong>Cereri rugaciune din data {$fromDate} in data {$toDate}</strong>";
foreach ($cereri as $cerere) {
$output .= "<br /><br />Nume: " . $cerere['nume'] . ", Localitate: " . $cerere['localitate'] . ", Data: " . $cerere['data'];
$output .= "<br />Continut: " . $cerere['continut'];
}
$pdf->PrintChapter($output, true);
$pdf->Output('cereri-rugaciune.pdf', 'I');
}
示例8: cetak_kertas_resep
public function cetak_kertas_resep()
{
$this->load->library('Pdf');
$pdf = new Pdf('P', 'mm', 'A5', true, 'UTF-8', false);
// $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetPageOrientation('P');
$pdf->SetAuthor('Pemerintah Kota Bogor');
$pdf->SetTitle('Resep Obat');
$pdf->SetSubject('Resep Obat');
$pdf->SetKeywords('Resep Obat');
// $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, 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);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
require_once dirname(__FILE__) . '/lang/eng.php';
$pdf->setLanguageArray($l);
}
$pdf->setFontSubsetting(true);
$pdf->SetFont('helvetica', '', 11, '', true);
$pdf->AddPage();
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
$puskesmas = $this->m_rujukan->get_puskesmas_info($this->session->userdata('kd_puskesmas'));
$kd_trans_pelayanan = $this->uri->segment(3);
$surat = $this->m_rujukan->get_data_pasien($kd_trans_pelayanan);
if ($surat['alamat'] == '') {
$surat['alamat'] = "-";
}
if ($surat['umur'] == '') {
$surat['umur'] = "-";
}
if ($surat['jenis_kelamin'] == '') {
$surat['jenis_kelamin'] = "-";
}
if ($surat['idkartu_medical'] == '') {
$surat['idkartu_medical'] = "-";
}
if ($surat['kd_bayar'] == '') {
$surat['kd_bayar'] = "-";
}
if ($surat['no_asuransi'] == '') {
$surat['no_asuransi'] = "-";
}
if ($surat['nm_dokter'] == '') {
$surat['nm_dokter'] = "_____________________";
}
$tgl = date('d-m-Y');
#echo $this->db->last_query(); exit;
$html = '<table align="center" border="0" align="left">';
$html .= '
<tr>
<td width="20%" style="text-align: center;"><img src="' . base_url() . 'assets/img/logo.png" width="80" height="80"/></td>
<td width="80%" style="text-align: center;"><h4>00/DOK IN PKM - USI/01/PKM/151/2011</h4><br><h3>PEMERINTAH PROPINSI ' . $puskesmas["nm_propinsi"] . '<br>DINAS KESEHATAN KOTA ' . $puskesmas["nm_kota"] . '</h3>
<h4>UPTD ' . $puskesmas["nm_puskesmas"] . '<br>' . $puskesmas["alamat"] . '<br>' . $puskesmas["no_telp"] . '</h4>
</td>
</tr>';
$html .= '</table>';
$html .= '<p align="left"><b>Resep Obat</b></p>';
$html .= '<table align="center" cellpadding="2" cellspacing="0" border="0" width="100%">
<tr>
<td width="20%" border="1px" style="text-align: center;">' . $surat["kd_bayar"] . '</td>
<td width="5%" style="text-align: left;"></td>
<td width="75%" style="text-align: right;">' . $puskesmas["nm_kota"] . ', ' . $tgl . '</td>
</tr>
<tr>
<td style="text-align: right;" colspan="3">No KK: ' . $surat["idkartu_medical"] . '</td>
</tr>
<tr>
<td style="text-align: right;" colspan="3">No R.M. Pasien: ' . $surat["kd_rekam_medis"] . '</td>
</tr>
<tr>
<td><p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p><p> </p><p> </p>
<p> </p></td>
</tr>
<tr>
<td style="text-align: right;" colspan="3">Pemeriksa, </td>
</tr>
<tr>
<td><p> </p>
<p> </p></td>
</tr>
<tr>
<td style="text-align: right;" colspan="3">' . $surat["nm_dokter"] . '</td>
</tr>
//.........这里部分代码省略.........
示例9: exportInvoice
public function exportInvoice($ids)
{
$pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8');
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Gekosale');
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
$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);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setLanguageArray(1);
$pdf->SetFont('dejavusans', '', 10);
$sql = 'SELECT
*
FROM invoice
WHERE
idinvoice IN (' . implode(',', $ids) . ')';
$stmt = Db::getInstance()->prepare($sql);
$stmt->execute();
$Data = array();
while ($rs = $stmt->fetch()) {
switch ($rs['contenttype']) {
case 'html':
$data = $rs['contentcopy'];
$pdf->AddPage();
$pdf->writeHTML($data, true, 0, true, 0);
break;
}
}
@ob_clean();
$pdf->Output('Faktury z ' . date('Y-m-d'), 'D');
}
示例10: Pdf
<?php
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Anibal Urbiola');
$pdf->SetTitle('Descarga de la ficha de chikungunya');
$pdf->SetSubject('Conversion a PDF');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
// datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config_alt.php de libraries/config
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 001', PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));
$pdf->setFooterData($tc = array(0, 64, 0), $lc = array(0, 64, 128));
// datos por defecto de cabecera, se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// se pueden modificar en el archivo tcpdf_config.php de libraries/config
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//relación utilizada para ajustar la conversión de los píxeles
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// ---------------------------------------------------------
// establecer el modo de fuente por defecto
$pdf->setFontSubsetting(true);
// Establecer el tipo de letra
//Si tienes que imprimir carácteres ASCII estándar, puede utilizar las fuentes básicas como
// Helvetica para reducir el tamaño del archivo.
$pdf->SetFont('courier', '', 14, '', true);
示例11: generate_letter_support_pdf
public function generate_letter_support_pdf($arrData, $pData)
{
$this->load->model('setup_model');
$letter = $this->setup_model->get_by(array('name' => 'Letter'));
$ward_letter = $this->setup_model->get_by(array('name' => 'Ward Leader Letter'));
$support_letter = $this->setup_model->get_by(array('name' => 'Letter of Support'));
$this->load->library('pdf');
$pdf = new Pdf('L', 'mm', 'LETTER', true, 'ISO-8859-1', false);
$pdf->SetTitle($pData['brgy'] . '-LETTER-' . date("YmdHis"));
$pdf->SetHeaderMargin(0);
$pdf->SetTopMargin(10);
$pdf->SetLeftMargin(20);
$pdf->SetRightMargin(20);
$pdf->setFooterMargin(10);
$pdf->SetAutoPageBreak(true, 10);
$pdf->SetFontSize(10);
$pdf->SetAuthor('Author');
// set font
$pdf->SetFont('freeserif', '', 10);
$ctr = 0;
foreach ($arrData as $result) {
if ($ctr % 2 == 0) {
$pdf->AddPage('P', 'LEGAL');
$pdf->setY(15);
} else {
$pdf->setY(190);
}
$result = (object) $result;
$voter_name = explode(",", htmlentities($result->full_name));
$html = "";
$html .= "<br/>";
$html .= '<b>' . trim(htmlentities($result->full_name)) . '</b>';
$html .= "<br/>";
$html .= '<b>' . trim($result->brgy) . '</b>';
$html .= "<br/>";
$html .= '<b>' . trim($result->precinct) . '</b>';
$html .= "<br/>";
$html .= "<br/>";
$html .= 'Minamahal na <b>' . (trim($result->gender) == 'M' ? 'G.' : 'Bb/Gng.') . " " . ucfirst(trim(strtolower(htmlentities($voter_name[0])))) . ":</b>";
$html .= "<br/>";
// $html .= $is_ward ? $ward_letter['content'] : $letter['content'];
$html .= $support_letter['content'];
$html .= "<br/>";
$html .= '<table>' . '<tr>' . '<td width="60%"></td>' . '<td>Gumagalang, </td>' . '</tr>' . '<tr>' . '<td width="60%"></td>' . '</tr>' . '<tr>' . '<td width="50%" align="center"><b> <img src="' . base_url('assets/images/alexander_pajarillo_sign.jpg') . '" height="55" width="150"/></b></td>' . '<td width="50%" align="center"><b> <img src="' . base_url('assets/images/edgardo_tallado_sign.jpg') . '" height="55" width="150"/></b></td>' . '</tr>' . '<tr>' . '<td width="50%" align="center"><i>Mayor</i></td>' . '<td width="50%" align="center"><i>Governor</i></td>' . '</tr>' . '<tr>' . '<td width="60%"></td>' . '</tr>' . '<tr>' . '<td width="100%" align="center"><u> <b>' . trim(htmlentities($result->full_name)) . '</b> </u></td>' . '</tr>' . '<tr>' . '<td width="100%" align="center">Lagda</td>' . '</tr>' . '</table>';
$pdf->writeHTML($html, true, false, false, false, '');
$ctr++;
// if($ctr == 1){
// $pdf->setY(100);
// $ctr = 0;
// }
}
$pdf->Output('letter.pdf', 'I');
exit;
pe($letter);
}
示例12: letters
public function letters()
{
$this->load->library('pdf');
$pdf = new Pdf('L', 'mm', 'LETTER', true, 'UTF-8', false);
$pdf->SetTitle('Letter to vote');
$pdf->SetHeaderMargin(30);
$pdf->SetTopMargin(20);
$pdf->setFooterMargin(10);
$pdf->SetAutoPageBreak(true, 15);
$pdf->SetAuthor('Author');
$pdf->AddPage('P', 'LEGAL');
$pdf->setY(30);
$pdf->Output('letter.pdf', 'I');
}
示例13: pdf
function pdf()
{
$data['matricula'] = $this->input->post('matricula');
$data['nombre'] = $this->input->post('nombre');
$data['paterno'] = $this->input->post('paterno');
$data['materno'] = $this->input->post('materno');
$data['fecha_carga'] = $this->input->post('fecha_carga');
$data['id_archivo'] = $this->input->post('id_archivo');
$data['curp'] = $this->input->post('curp');
$data['correo'] = $this->input->post('correo');
$data['tel'] = $this->input->post('tel');
$data['institucion'] = $this->input->post('institucion');
$data['plantel'] = $this->input->post('plantel');
$data['grado'] = $this->input->post('grado');
$data['turno'] = $this->input->post('turno');
$data['promedio'] = $this->input->post('promedio');
$data['modalidad'] = $this->input->post('sistema');
$data['padre'] = $this->input->post('padre');
$data['madre'] = $this->input->post('madre');
$data['ecivil'] = $this->input->post('e_civil');
$data['sexo'] = $this->input->post('sexo');
$data['fecha_nac'] = $this->input->post('fecha_nac');
//$data['']= $this->input->post('');
$data['cel'] = $this->input->post('cel');
if ($data['cel'] == '') {
$data['cel'] = '----';
}
$data['calle'] = $this->input->post('calle');
if ($data['calle'] == '') {
$data['calle'] = '----';
}
$data['noext'] = $this->input->post('noext');
if ($data['noext'] == '') {
$data['noext'] = '----';
}
$data['noint'] = $this->input->post('noint');
if ($data['noint'] == '') {
$data['noint'] = '----';
}
$data['manzana'] = $this->input->post('manzana');
if ($data['manzana'] == '') {
$data['manzana'] = '----';
}
$data['lote'] = $this->input->post('lote');
if ($data['lote'] == '') {
$data['lote'] = '----';
}
$data['noedif'] = $this->input->post('noedif');
if ($data['noedif'] == '') {
$data['noedif'] = '----';
}
$data['nodpto'] = $this->input->post('nodpto');
if ($data['nodpto'] == '') {
$data['nodpto'] = '----';
}
$data['andador'] = $this->input->post('andador');
if ($data['andador'] == '') {
$data['andador'] = '----';
}
$data['rampa'] = $this->input->post('rampa');
if ($data['rampa'] == '') {
$data['rampa'] = '----';
}
$data['pasillo'] = $this->input->post('pasillo');
if ($data['pasillo'] == '') {
$data['pasillo'] = '----';
}
$data['villa'] = $this->input->post('villa');
if ($data['villa'] == '') {
$data['villa'] = '----';
}
$data['entrada'] = $this->input->post('entrada');
if ($data['entrada'] == '') {
$data['entrada'] = '----';
}
$data['colonia'] = $this->input->post('colonia');
if ($data['colonia'] == '') {
$data['colonia'] = '----';
}
$data['delegacion'] = $this->input->post('delegacion');
if ($data['delegacion'] == '') {
$data['delegacion'] = '----';
}
$data['cp'] = $this->input->post('cp');
if ($data['cp'] == '') {
$data['cp'] = '----';
}
$this->load->library('Pdf');
$pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Cony Jaramillo');
$pdf->SetTitle('Documentos Prepa Si');
$pdf->SetSubject('Reimpresión de Documentos');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
ob_start();
//remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// set default header data
// set margins
//.........这里部分代码省略.........
示例14: getInvoiceById
public function getInvoiceById($id)
{
$pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8');
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Gekosale');
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
$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);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setLanguageArray(1);
$pdf->SetFont('dejavusans', '', 10);
$sql = 'SELECT
*
FROM invoice I
LEFT JOIN `order` O ON O.idorder = I.orderid
WHERE
I.idinvoice = :id AND IF(O.clientid IS NOT NULL, O.clientid = :clientid, 1)';
$stmt = Db::getInstance()->prepare($sql);
$stmt->bindValue('id', $id);
$stmt->bindValue('clientid', Session::getActiveClientid());
$stmt->execute();
$rs = $stmt->fetch();
$Data = array();
if ($rs) {
switch ($rs['contenttype']) {
case 'html':
$htmlcontent = $rs['contentoriginal'];
$pdf->AddPage();
$pdf->writeHTML($htmlcontent, true, 0, true, 0);
@ob_clean();
$pdf->Output($rs['symbol'], 'D');
break;
case 'pdf':
$data = base64_decode($rs['contentoriginal']);
header('Content-Type: application/pdf');
header('Content-Description: File Transfer');
header('Content-Transfer-Encoding: binary');
header('Content-Disposition: attachment; filename="' . $rs['symbol'] . '.pdf"');
header('Content-Length: ' . strlen($data));
header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0');
header('Expires: 0');
echo $data;
exit;
break;
}
}
}
示例15: index
public function index()
{
if ($this->input->post('action') != NULL && $this->input->post('action') == 'user_survey') {
if ($cats = $this->questionnaire_model->get_question_cats()) {
foreach ($cats as $cat) {
$data[$cat->id_questionnaire] = array();
if ($questions = $this->questionnaire_model->get_questionnaire($cat->id_questionnaire)) {
foreach ($questions as $q) {
$data[$cat->id_questionnaire][] = $this->input->post('answer_' . $q->question_no);
}
}
}
}
$survey_data = serialize($data);
$created_at = date(DATETIME_DATABASE_FORMAT);
$table_data = array('id_user' => $this->session->userdata('id_user'), 'survey_data' => $survey_data, 'created_at' => $created_at);
if ($this->site_model->insert('smg_survey', $table_data)) {
date_default_timezone_set('Australia/NSW');
$ImageW = 105;
//WaterMark Size
$ImageH = 30;
$id_user = $this->session->userdata('id_user');
$display_name = $this->session->userdata('display_name');
$getOrganization = $this->survey_model->get_organization($id_user);
$getsurveydetails = $this->survey_model->getsurveydetails($id_user, $created_at);
$getsurveydetail = unserialize($getsurveydetails);
$this->load->library('Pdf');
$pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('AMIT');
$pdf->SetTitle('SMG Health Survey Report');
$pdf->SetSubject('Survey Report');
$pdf->SetKeywords('SMG Health Survey Report ');
// 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(PDF_MARGIN_LEFT, PDF_MARGIN_TOP - 15, 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);
}
$pdf->SetFont('freeserif', '', 48);
// remove default header
$pdf->setPrintHeader(false);
// add a page
$pdf->AddPage();
// get the current page break margin
$bMargin = $pdf->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $pdf->getAutoPageBreak();
// disable auto-page-break
$pdf->SetAutoPageBreak(false, 0);
// set bacground image
$img_file = Base_url() . 'assets/site/images/coverImage.jpg';
$pdf->Image($img_file, 0, 0, 210, 297, '', '', '', false, 400, '', false, false, 0);
// restore auto-page-break status
$pdf->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
$pdf->setPageMark();
// Print a text
$html = '<div style="position: relative; right:0; left:0; text-align:center; padding: 50px 15px;">
<h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;">SMG Health Bounce Back Survey</h1>
<h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;"> </h1>
<h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;"> </h1>
<h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;"> </h1>
<h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;"> </h1>
<h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;"> </h1>
<h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;"> </h1>
<h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;"> </h1>
<h1 style="margin: 0 0 20px; color: #333; font-weight: 500;font-size: 40px;"> </h1>
<h1 style="margin: 100px 0 0px; color: #000; font-weight: 500;font-size: 24px; text-transform: capitalize;">' . $getOrganization . '</h1>
<h1 style="margin: 0 0 20px; color: #000; font-weight: 500;font-size: 18px;">' . $created_at . '</h1>
</div>';
$pdf->writeHTML($html, true, false, true, false, '');
// ---------------------------------------------------------
$img_file = Base_url() . 'assets/site/images/innerbanner.jpg';
$pdf->AddPage();
$myPageWidth = $pdf->getPageWidth();
$myPageHeight = $pdf->getPageHeight();
$myX = $myPageWidth / 2 - 50;
$myY = $myPageHeight / 2 - 40;
$pdf->SetAlpha(0.09);
$pdf->Image(Base_url() . 'assets/site/images/dase_logo.png', $myX, $myY, $ImageW, $ImageH, '', '', '', true, 150);
$pdf->SetAlpha(1);
$pdf->Image($img_file, 0, 0, 210, 47, '', '', '', false, 300, '', false, false, 0);
$pdf->SetDrawColor(255, 0, 0);
$content = '<table cellspacing="0" cellpadding="0">
<tr><td><img title="" alt="" src="' . Base_url() . 'assets/site/images/dase_logo.png"></td></tr>
<tr><td>' . $display_name . '</td></tr>
<tr><td>' . $created_at . '</td></tr>
//.........这里部分代码省略.........