本文整理汇总了PHP中Pdf::SetTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Pdf::SetTitle方法的具体用法?PHP Pdf::SetTitle怎么用?PHP Pdf::SetTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pdf
的用法示例。
在下文中一共展示了Pdf::SetTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: 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');
}
示例3: imprimir_detalle
public function imprimir_detalle()
{
$data['id'] = $this->input->post('id');
$data['cliente'] = $this->clientes->buscar_cliente_detalle($data);
$data['orden'] = $this->clientes->buscar_orden_detalle($data);
$html = $this->load->view('pdf/detalle_cliente', $data, true);
/////////////
$this->load->library('Pdf');
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetTitle('Titulo Generación de Etiqueta');
$pdf->SetSubject('Subtitulo');
$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->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('freemono', '', 14, '', true);
$pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal'));
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(10, 10, 10);
$pdf->SetAutoPageBreak(true, -10);
$pdf->AddPage('P', array(215.9, 279.4));
//en mm 21.59cm por 27.94cm
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
$nombre_archivo = utf8_decode("informe" . ".pdf");
$pdf->Output($nombre_archivo, 'I');
}
示例4: generar_turno
public function generar_turno($numero, $cita)
{
$data['numero'] = base64_decode($numero);
$data['cita'] = base64_decode($cita);
$this->load->library('Pdf');
$pdf = new Pdf('P', 'mm', 'A4', true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
//$pdf->SetAuthor('Osmel Calderón');
$pdf->SetTitle('Titulo Generación de Etiqueta');
$pdf->SetSubject('Subtitulo');
//$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);
//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('freemono', '', 14, '', true);
// 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
//$provincia = $this->input->post('provincia');
//$data['id_movimiento']='29';
// 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_MARGIN_BOTTOM);
// set margins
$pdf->SetMargins(0, 0, 0);
// set auto page breaks
$pdf->SetAutoPageBreak(true, -10);
$pdf->AddPage('P', array(100.0, 100.0));
//en mm
//$pdf->AddPage(); //en mm
$html = $this->load->view('pdfs/turno', $data, 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($data['numero'] . ".pdf");
$pdf->Output($nombre_archivo, 'I');
}
示例5: 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');
}
示例6: 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');
}
示例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: 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);
}
示例9: 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
//.........这里部分代码省略.........
示例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_statistics
//.........这里部分代码省略.........
$summary[] = $myField;
}
//$allfields[]=$myField;
}
} else {
// This gets all the 'to be shown questions' from the POST and puts these into an array
if (!is_array($q2show)) {
$summary = returnGlobal('summary');
} else {
$summary = $q2show;
}
//print_r($_POST);
//if $summary isn't an array we create one
if (isset($summary) && !is_array($summary)) {
$summary = explode("+", $summary);
}
}
/**
* pdf Config
*/
if ($outputType == 'pdf') {
//require_once('classes/tcpdf/config/lang/eng.php');
global $l;
$l['w_page'] = $statlang->gT("Page", 'unescaped');
//require_once('classes/tcpdf/mypdf.php');
Yii::import('application.libraries.admin.pdf', true);
// create new PDF document
$pdf = new Pdf();
$pdf->SetFont($pdfdefaultfont, '', $pdffontsize);
$surveyInfo = getSurveyInfo($surveyid, $language);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('LimeSurvey');
$pdf->SetTitle('Statistic survey ' . $surveyid);
$pdf->SetSubject($surveyInfo['surveyls_title']);
$pdf->SetKeywords('LimeSurvey, Statistics, Survey ' . $surveyid . '');
$pdf->SetDisplayMode('fullpage', 'two');
// set header and footer fonts
$pdf->setHeaderFont(array($pdfdefaultfont, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(array($pdfdefaultfont, '', PDF_FONT_SIZE_DATA));
// set default header data
$pdf->SetHeaderData("statistics.png", 10, $statlang->gT("Quick statistics", 'unescaped'), $statlang->gT("Survey") . " " . $surveyid . " '" . flattenText($surveyInfo['surveyls_title'], false, true, 'UTF-8') . "'");
// 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);
}
if ($outputType == 'xls') {
/**
* Initiate the Spreadsheet_Excel_Writer
*/
Yii::import('application.libraries.admin.pear.Spreadsheet.Excel.Xlswriter', true);
if ($pdfOutput == 'F') {
$sFileName = $tempdir . '/statistic-survey' . $surveyid . '.xls';
$workbook = new Xlswriter($sFileName);
} else {
$workbook = new Xlswriter();
}
示例12: library
function make_pdf($PDF_html, $PDF_name='Ads2Trade_Document', $PDF_Title='Ads2Trade Dcoument', $PDF_Orientation="L")
{
$CI =& get_instance();
$CI->load->library('pdf'); // load library (if not already loaded - CI will handle this check for us though)
// create new PDF document
//$pdf = new TCPDF($PDF_Orientation, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf = new Pdf($PDF_Orientation, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$html = $PDF_html;
//Make sure orientation is valid i.e. either P or L
if($PDF_Orientation != 'P' && $PDF_Orientation != 'L'){
$PDF_Orientation = 'L'; //default to landscape if invalid value supplied
}
$pdf->setPageOrientation($PDF_Orientation); //custom class seemed to not be picking up orientation in constructor
if($PDF_name == '' or is_null($PDF_name)){
$PDF_name = 'Ads2Trade_Document'; //default to landscape if invalid value supplied
}
// set document information
//$pdf->SetCreator(PDF_CREATOR);
$pdf->SetCreator("Ads2Trade");
$pdf->SetAuthor('Ads2Trade');
$pdf->SetTitle('Ads2Trade Document Title Goes Here');
$pdf->SetSubject('Ads2Trade');
$pdf->SetKeywords('Ads2Trade, PDF, asset, auction, advertising');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, $PDF_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('dejavusans', '', 10);
// add a page
$pdf->AddPage();
// create some HTML content
if (is_null($html) or ($html == '')) {
$html = '<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<p>ERROR: No Document Data Supplied</p>
</body>
</html>';
}
// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output($PDF_name.'.pdf', 'I');
}
示例13: index
function index()
{
date_default_timezone_set('Australia/NSW');
$ImageW = 105;
//WaterMark Size
$ImageH = 30;
$id_user = $this->uri->segment(2);
$created_at = urldecode($this->uri->segment(3));
$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>
<tr><td> </td></tr>
<tr><td> </td></tr>
</table>';
$content .= '<div style="padding: 30px;">
<p style="margin: 0 0 10px;color: #424242;font-weight: 500;font-size: 20px;">Introduction</p>
<p>Thank you for completing your Bounce Back Survey. This report provides you with a summary of your results, makes some personalised recommendations and provides you with the tools to create an action plan.</p>
<p>Each dimension is presented individually with a description of your results and strategies for strengthening.</p>
<p style="margin: 5px 0 10px;color: #424242;font-weight: 500;font-size: 20px;">Understanding Your Report</p>
<p>Your report contains a description of the 10 dimensions of resilience for which you were assessed. Your individual assessment results for each dimension is presented as a flag. Refer to the table below when reading your report.</p>
<p>Red flag: <img src="' . Base_url() . 'assets/site/images/close_icon.jpg" height="25" alt="">
Green Flag:<img src="' . Base_url() . 'assets/site/images/tick_icon.jpg" height="25" alt=""></p>
<p style="margin: 5px 0 10px; color: #424242; font-weight: 500; font-size: 20px;">Summary of Results</p>
<table style="text-align: left;">
<thead>
//.........这里部分代码省略.........
示例14: 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>
//.........这里部分代码省略.........
示例15: 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');
}