本文整理汇总了PHP中Pdf::Image方法的典型用法代码示例。如果您正苦于以下问题:PHP Pdf::Image方法的具体用法?PHP Pdf::Image怎么用?PHP Pdf::Image使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pdf
的用法示例。
在下文中一共展示了Pdf::Image方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generarReporteEventoGeneralSeleccionFecha
public function generarReporteEventoGeneralSeleccionFecha()
{
$fecha = date("Y-m-d", strtotime($this->input->get('fecha')));
$pdf = new Pdf('L', 'mm', 'Legal', true, 'UTF-8', false);
$pdf->setPageOrientation('l');
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, 15, PDF_MARGIN_RIGHT);
//$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
//$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING, array(0, 64, 255), array(0, 64, 128));
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('times', '', 12, '', true);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->AddPage();
$html = null;
$pdf->SetFont('Times', 'B', 14);
$pdf->Image("imagen/logo/bannerprevengo2.png", $x = 5, $y = 5, $w = 290, $h = 40, $type = 'PNG', $link = '', $align = 'right', $resize = false, $dpi = 300, $palign = '', $ismask = false, $imgmask = false, $border = 0, $fitbox = false, $hidden = false, $fitonpage = false, $alt = false, $altimgs = array());
$pdf->SetTextColor('0', '25', '215');
$pdf->Text(130, 12, "República Bolivariana de Venezuela", $fstroke = false, $fclip = false, $ffill = true, $border = 0, $ln = 0, $align = 'left', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M', $rtloff = false);
$pdf->Text(130, 17, "Gobernación del Estado Lara", $fstroke = false, $fclip = false, $ffill = true, $border = 0, $ln = 0, $align = 'left', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M', $rtloff = false);
$pdf->Text(130, 23, "Oficina de Personal--División de Planificación y Presupuesto.", $fstroke = false, $fclip = false, $ffill = true, $border = 0, $ln = 0, $align = 'left', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M', $rtloff = false);
$pdf->SetFont('Times', 'B', 12);
$pdf->SetTextColor('8', '8', '8');
// $pdf->Text(50, 35, 'Reporte General de Eventos.');
// $pdf->Ln(20);
//$pdf->Text(30, 40, 'Fecha:' . date('d-m-Y'), $align = 'rigth');
$pdf->Ln(15);
$pdf->SetFont('times', '', 11, '', true);
$ano = date('Y');
$mesesN = array(1 => "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
$mes = $mesesN[date('n')];
$dia = date('d');
$html .= '
<table>
<tr colspan="8">
<td colspan="2"><p align="center"><b></b></p></td>
<td colspan="2" ><p align="center"><b></b></p></td>
<td colspan="2"><p align="center"><b>Barquisimeto, ' . $dia . ' de ' . $mes . ' del ' . $ano . '</b></p></td>
</tr>
</table>';
$html .= "<h1>Reporte General de Eventos con las siguientes caracteristicas: </h1>";
$html .= '
<table border="1">
<tr colspan="1" width="5" heigth="5">
<td colspan="1" bgColor="#429DED"><p align="center"><b> Fecha </b></p></td>
</tr>
<tr colspan="1" width="5" heigth="5">
<td colspan="1" bgColor=""><p align="center"><b> ' . date("Y-m-d", strtotime($this->input->get('fecha'))) . '</b></p></td>
</tr>
</table>';
$condicion = 'evento.fechatope="' . $fecha . '"';
$reporte = $this->evento_model->cargarListaEventoSeleccionPDF($condicion);
$html .= "<H1></h1>";
if ($reporte->num_rows() > 0) {
$html .= '
<table border="1">
<tr colspan="8">
<td colspan="3" bgColor="#429DED"><p align="center"><b>Titulo</b></p></td>
<td colspan="10" bgColor="#429DED"><p align="center"><b>Descripción</b></p></td>
<td colspan="2" bgColor="#429DED"><p align="center"><b>Tipo de Evento</b></p></td>
<td colspan="2" bgColor="#429DED"><p align="center"><b>Sector</b></p></td>
<td colspan="2" bgColor="#429DED"><p align="center"><b>Alcance</b></p></td>
<td colspan="2" bgColor="#429DED"><p align="center"><b>Agente</b></p></td>
<td colspan="2.5" bgColor="#429DED"><p align="center"><b>Estatus</b></p></td>
</tr>';
foreach ($reporte->result_array() as $fila2) {
$html .= '<tr colspan="8">
<td colspan="3"><p align="center">' . $fila2['titulo'] . '</p></td>
<td colspan="10"><p align="center">' . $fila2['descripcion'] . '</p></td>
<td colspan="2"><p align="center">' . $fila2['tipoEv'] . '</p></td>
<td colspan="2"><p align="center">' . $fila2['sector'] . '</p></td>
<td colspan="2"><p align="center">' . $fila2['alcance'] . '</p></td>
<td colspan="2"><p align="center">' . $fila2['agente'] . '</p></td>
<td colspan="2.5"><p align="center">' . $fila2['estatus'] . '</p></td>
</tr>';
}
$html .= '<tr>
<td colspan="21"><p align="right"> Cantidad de Eventos: </p></td>
<td colspan="2"><p align="center">' . $reporte->num_rows() . '</p></td>
</tr>
</table>';
} else {
$html .= '<h1>No se encuentra eventos registrados para la fecha seleccionada.</h1>';
}
$nombre_archivo = utf8_decode("reporteEventos.pdf");
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'C', $autopadding = true);
$pdf->Output($nombre_archivo, 'I');
}
示例2: reporteEstatusPdf
public function reporteEstatusPdf()
{
$pdf = new Pdf('L', 'mm', 'A4', true, 'UTF-8', false);
$pdf->setPageOrientation('p');
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, 15, PDF_MARGIN_RIGHT);
//$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('times', '', 12, '', true);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->AddPage();
$html = null;
$reporteEstatus = $this->reporteticket_model->reporteEstatusPDF();
if ($reporteEstatus) {
$pdf->Image("imagen/logo/logoborde.png", $x = 5, $y = 5, $w = 70, $h = 40, $type = '', $link = '', $align = 'right', $resize = false, $dpi = 300, $palign = '', $ismask = false, $imgmask = false, $border = 0, $fitbox = false, $hidden = false, $fitonpage = false, $alt = false, $altimgs = array());
$pdf->Text(120, 15, "República Bolivariana de Venezuela", $fstroke = false, $fclip = false, $ffill = true, $border = 0, $ln = 0, $align = 'left', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M', $rtloff = false);
$pdf->Text(120, 20, "Gobernación del Estado Lara", $fstroke = false, $fclip = false, $ffill = true, $border = 0, $ln = 0, $align = 'left', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M', $rtloff = false);
$pdf->Text(120, 25, "Oficina de Atención al Ciudadano.", $fstroke = false, $fclip = false, $ffill = true, $border = 0, $ln = 0, $align = 'left', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M', $rtloff = false);
$pdf->SetFont('Times', 'B', 12);
$pdf->Text(60, 50, 'Reporte estadistico del estatus de los Ticket registrados.');
foreach ($reporteEstatus->result_array() as $fila) {
$arregloDatos[] = array('estatus' => $fila['estatus'], 'contador' => $fila['contador']);
}
$pdf->Ln(10);
$pdf->SetFillColor('150', '210', '255');
$pdf->Cell(0, 0, 'Cuadro Resumen', 1, 1, 'C', 1);
$pdf->Cell(75, 0, 'Tipo ticket', 1, 0, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M');
$pdf->Cell(75, 0, 'Sector relacionado', 1, 0, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M');
$pdf->Cell(30, 0, 'Cantidad', 1, 1, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M');
$reporteCuadro = $this->reporteticket_model->reporteEstatusCuadroPDF();
foreach ($reporteCuadro as $fila2) {
$pdf->Cell(75, 0, $fila2->tipo, 1, 0, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M');
$pdf->Cell(75, 0, $fila2->sector, 1, 0, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M');
$pdf->Cell(30, 0, $fila2->cantidad, 1, 1, 'C', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M');
$total = $fila2->total;
}
$pdf->Cell(150, 0, 'Total de ticket', 1, 0, 'R', $fill = false, $link = '', $stretch = 0, $ignore_min_height = false, $calign = 'T', $valign = 'M');
$pdf->Cell(30, 0, $total, 1, 1, 'C', 1);
$pdf->Ln(10);
$pdf->graficoPDF($arregloDatos, 'Grafico', array(60, '', 90, 100), '');
} else {
$pdf->SetFont('Times', 'B', 18);
$pdf->Text(14, 40, 'No se encuentra información con las características indicadas.');
}
$nombre_archivo = utf8_decode("listado.pdf");
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'C', $autopadding = true);
$pdf->Output($nombre_archivo, 'I');
}
示例3: die
$result = $dbconn->execute($query);
$numofresults = $result->fields['count'];
if ($numofresults < 1) {
die(_("No vulnerabilities recorded"));
}
$chinese = false;
// the language is not chinese by default
//start pdf file, add page, set font
$pdf = new Pdf();
$pdf->AddGBFont();
$pdf->AddBig5Font();
$pdf->AddPage();
$pdf->SetFont('Helvetica', 'B', 13);
if (Session::is_pro()) {
if ($siteLogo != '') {
$pdf->Image($siteLogo, 10, 11, 40);
} else {
$pdf->Image("../pixmaps/logo_siempdf.png", 10, 11, 40);
}
} else {
$pdf->Image("../pixmaps/logo_ossimpdf.png", 10, 11, 40);
}
$pdf->Ln();
$pdf->Cell(0, 16, " {$siteBranding}: I.T Security Vulnerability Report", 1, 1, 'C', 0);
$scan_time = _("Scan time");
$generated = _("Generated");
if (preg_match('/&#(\\d{4,5});/', $scan_time)) {
$scan_time = mb_convert_encoding($scan_time, 'Big5', 'HTML-ENTITIES');
$generated = mb_convert_encoding($generated, 'Big5', 'HTML-ENTITIES');
$pdf->SetFont('Big5', '', 9);
$chinese = true;
示例4: pdf
//.........这里部分代码省略.........
$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
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
//$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// 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);
}
///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
///////////////////////////////////////////////////FORMATO ENTREGA///////////////////////////////////////////////////
///////////////////////////////////////////////////---------------///////////////////////////////////////////////////
// establecer el modo de fuente por defecto
$pdf->setFontSubsetting(true);
// Establecer el tipo de letra
$pdf->SetFont('helvetica', '', 10);
//Normal
$arriba = 6;
$izq = 10;
$der = 10;
$pdf->AddPage('L', 'LETTER');
$pdf->SetFont('pdfahelvetica', '', 10);
//Normal
//$pdf->SetFont('pdfahelveticai', '', 10); // S
$pdf->SetTextColor(0, 0, 0);
$style = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,20,5,10', 'phase' => 10, 'color' => array(255, 0, 0));
$style2 = array('width' => 0.2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0));
$style3 = array('width' => 0.2, 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', 'color' => array(0, 0, 0));
$style4 = array('L' => 0, 'T' => array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => '20,10', 'phase' => 10, 'color' => array(100, 100, 255)), 'R' => array('width' => 0.5, 'cap' => 'round', 'join' => 'miter', 'dash' => 0, 'color' => array(50, 50, 127)), 'B' => array('width' => 0.75, 'cap' => 'square', 'join' => 'miter', 'dash' => '30,10,5,10'));
$style5 = array('width' => 0.25, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 64, 128));
$style6 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => '10,10', 'color' => array(0, 128, 0));
$style7 = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 128, 0));
# Marco
//$pdf->RoundedRect(5, 15-$arriba, 268, 200, 0, '1010', 'NULL');
$pdf->RoundedRect(12, 15 - $arriba, 120, 200, 0, '1000', 'NULL');
$pdf->RoundedRect(23 + 125, 15 - $arriba, 120, 200, 0, '1000', 'NULL');
示例5: 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>
//.........这里部分代码省略.........
示例6: 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>
//.........这里部分代码省略.........
示例7: generarReporteActividadEvento
public function generarReporteActividadEvento()
{
$idEvento = $this->input->get('idEv');
$html = null;
$pdf = new Pdf('L', 'mm', 'Legal', true, 'UTF-8', false);
$pdf->setPageOrientation('l');
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, 15, PDF_MARGIN_RIGHT);
$pdf->setHeaderMargin(2);
$pdf->SetHeaderData('bannerprevengo4.png', 270, 'Gobernacion de Lara', 'Oficina de Personal--División de Planificación y Presupuesto', array(0, 64, 255), array(0, 64, 128));
$pdf->setFooterMargin(12);
$pdf->setFooterData();
$pdf->SetAlpha(1, 'Normal');
$pdf->Image('imagen/logo/degradado.PNG', 30, 54, 100, 104, '', '', 'N', '', '', 'C');
// recuperamos la opacidad por defecto
$pdf->SetAlpha(1, 'Normal');
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('times', '', 12, '', true);
$pdf->SetFont('Times', 'B', 12);
$pdf->setPrintHeader(true);
$pdf->setPrintFooter(true);
$pdf->AddPage();
$pdf->SetTextColor('8', '8', '8');
$pdf->Ln(10);
$pdf->SetFont('times', '', 11, '', true);
$ano = date('Y');
$mesesN = array(1 => "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
$mes = $mesesN[date('n')];
$dia = date('d');
$html .= '
<table>
<tr colspan="8">
<td colspan="8"><p align="rigth"><b>Barquisimeto, ' . $dia . ' de ' . $mes . ' del ' . $ano . '</b></p></td>
</tr>
</table>';
$html .= "<h1>Reporte General de Metas alcanzada para las actividades</h1>";
$condicion = 'evento.id=' . $idEvento;
$reporte = $this->evento_model->cargarListaEventoSeleccionPDF($condicion);
if ($reporte->num_rows > 0) {
foreach ($reporte->result_array() as $fila2) {
$html .= '
<table border="1">
<tr colspan="4">
<td colspan="4" bgColor="#429DED"><p align="center"><b>Evento</b></p></td>
</tr>
<tr colspan="4">
<td colspan="1" bgColor="#429DED"><p align="center"><b>Titulo</b></p></td>
<td colspan="2" bgColor="#429DED"><p align="center"><b>Descripción</b></p></td>
<td colspan="1" bgColor="#429DED"><p align="center"><b>Estatus</b></p></td>
</tr>
<tr colspan="4">
<td colspan="1"><p align="center">' . $fila2['titulo'] . '</p></td>
<td colspan="2"><p align="center">' . $fila2['descripcion'] . '</p></td>
<td colspan="1"><p align="center">' . $fila2['estatus'] . '</p></td>
</tr>';
$reporte2 = $this->actividad_model->cargarMetaPlandeAccionDeEventoPDF($fila2['idEv']);
$html .= '<tr colspan="4">
<td colspan="4" bgColor="#429DED"><p align="center"><b>Plan de Accion</b></p></td>
</tr>';
if ($reporte2->num_rows > 0) {
foreach ($reporte2->result_array() as $fila2) {
$html .= '
<tr colspan="5">
<td colspan="1" bgColor="#00BFFF"><p align="center"><b>Actividad:</b></p></td>
<td colspan="1" bgColor="#00BFFF"><p align="center"><b>Meta Propuesta</b></p></td>
<td colspan="1" bgColor="#00BFFF"><p align="center"><b>Meta Alcanzada</b></p></td>
<td colspan="1" bgColor="#00BFFF"><p align="center"><b>Estatus</b></p></td>
</tr>
<tr colspan="4">
<td colspan="1" ><p align="center">' . $fila2['descripcion'] . '</p></td>
<td colspan="1" ><p align="center">' . $fila2['metap'] . '</p></td>
<td colspan="1" ><p align="center">' . $fila2['metaa'] . '</p></td>
<td colspan="1" ><p align="center">' . $fila2['estatus'] . '</p></td>
</tr>';
}
} else {
$html .= '<tr colspan="4">
<td colspan="4"><p align="center"><b> El evento no tiene plan de accion registrado.</b></p></td>
</tr>';
}
$html .= '</table>';
$html .= '<h1></H1>';
}
} else {
//.........这里部分代码省略.........