$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set font $pdf->SetFont('helvetica', '', 9); # creamos una página en blanco $pdf->Addpage(); $pdf->SetFont('helvetica', '', 9); // define barcode style $style = array('position' => 'R', 'align' => 'C', 'stretch' => 0, 'fitwidth' => 1, 'cellfitalign' => '', 'border' => 1, 'hpadding' => '2', 'vpadding' => '2', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'Helvetica', 'fontsize' => 6, 'stretchtext' => 4); $styleBC = array('position' => 'R', 'border' => 1, 'padding' => 2, 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 255), 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4); $estilo_tabla = "<style>\r\n .tablaFicha{\r\n width: 100%;\r\n font-size: 10px; \r\n }\r\n .celdaTablaFicha{\r\n border: 1px solid #CCCCCC;\r\n vertical-align: middle;\r\n }\r\n .fecha{\r\n text-align: right;\r\n }\r\n .encabezado{\r\n background-color: #EFEFEF;\r\n }\r\n</style>"; $sTituloReporte = "FICHA DE INGRESO A BANCO DE PROYECTOS"; //--------------------Contenido del reporte >--------------------------------------------------- $pdf->SetFont('times', 'L', 6); $pdf->write1DBarcode($infoBcoPDF['IdBco'], 'C39', '', '', '', 12, 0.4, $style, 'N'); $pdf->Ln(); $pdf->SetFont('times', '', 9); $pdf->Cell(0, 0, strtoupper($sTituloReporte), 0, 1, 'C', 0, 1); $pdf->Ln(2); $inicio_tabla_nomProyecto = ""; $inicio_tabla_nomProyecto .= "<table class=\"tablaFicha\" cellpadding=\"5\">\r\n <tr>\r\n <td colspan=\"6\" class=\"fecha\">FECHA DE REGISTRO:</td>\r\n <td class=\"celdaTablaFicha\">" . $infoBcoPDF['FecReg'] . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"celdaTablaFicha encabezado\">NOMBRE DEL PROYECTO:</td>\r\n <td class=\"celdaTablaFicha\" colspan=\"6\">" . utf8_encode($infoBcoPDF['NomObr']) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"celdaTablaFicha encabezado\">SECTOR:</td>\r\n <td class=\"celdaTablaFicha\" colspan=\"6\">" . utf8_encode($infoBcoPDF['NomSec']) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"celdaTablaFicha encabezado\">UNIDAD EJECUTORA:</td>\r\n <td class=\"celdaTablaFicha\" colspan=\"6\">" . utf8_encode($infoBcoPDF['NomUE']) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"celdaTablaFicha encabezado\">OBJETIVO DEL PROYECTO:</td>\r\n <td class=\"celdaTablaFicha\" colspan=\"6\">" . utf8_encode($infoBcoPDF['Justifi']) . "</td>\r\n </tr>\r\n <tr>\r\n <td class=\"celdaTablaFicha encabezado\" colspan=\"2\">VIDA ÚTIL DEL PROYECTO:</td>\r\n <td class=\"celdaTablaFicha\">" . utf8_encode($infoBcoPDF['vidaPry']) . " AÑOS</td>\r\n <td class=\"celdaTablaFicha encabezado\" colspan=\"2\">MONTO TOTAL DE INVERSIÓN:</td>\r\n <td class=\"celdaTablaFicha\" colspan=\"2\">\$" . number_format($infoBcoPDF['monto'], 2) . " </td>\r\n </tr>\r\n <tr>\r\n <td class=\"celdaTablaFicha encabezado\">COBERTURA:</td>\r\n <td class=\"celdaTablaFicha\">" . utf8_encode($infoBcoPDF['NomCob']) . "</td>"; if ($infoBcoPDF['IdCob'] === "2") { $inicio_tabla_nomProyecto .= "<td class=\"celdaTablaFicha encabezado\">REGIONES:</td>\r\n <td class=\"celdaTablaFicha\" colspan=\"4\">"; $regionesFicha = ""; for ($i = 0; $i < count($infoBcoPDF['regiones']); $i++) { $regionesFicha .= $infoBcoPDF['regiones'][$i]['CveReg'] . " " . utf8_encode($infoBcoPDF['regiones'][$i]['NomReg']) . ", "; } $regionesFicha = trim($regionesFicha, ", "); $inicio_tabla_nomProyecto .= $regionesFicha . "</td> "; } else {
public function generarReporte($atributosReceta, $labelCabecera, $labelDetalle, $labelPie, $datosCabecera, $datosDetalle, $datosExamen, $datosExamenUni, $datosGrupo, $datosPie, $modo, $nombreReceta, $parametros) { $lblCabecera = array(); $lblDetalle = array(); $lblPie = array(); $styleCL = array(); $styleCD = array(); $styleDL = array(); $styleDD = array(); $stylePL = array(); $stylePD = array(); $o_classGeneral = new classGeneral(); $o_classGeneral->setLabelCabecera($labelCabecera, $atributosReceta); $styleCL = $o_classGeneral->getStyleCL(); $styleCD = $o_classGeneral->getStyleCD(); $lblCabecera = $o_classGeneral->getLblCabecera(); $o_classGeneral->setLabelDetalle($labelDetalle, $atributosReceta); $styleDL = $o_classGeneral->getStyleDL(); $styleDD = $o_classGeneral->getStyleDD(); $lblDetalle = $o_classGeneral->getLblDetalle(); $o_classGeneral->setLabelPie($labelPie, $atributosReceta); $stylePL = $o_classGeneral->getStylePL(); $stylePD = $o_classGeneral->getStylePD(); $lblPie = $o_classGeneral->getLblPie(); $pdf = new MYPDF($parametros["PDF_PAGE_ORIENTATION"], PDF_UNIT, $parametros["PDF_PAGE_FORMAT"], true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Juan Carlos Ludeña Montesinos'); $pdf->SetTitle('Generardor de Reportes'); $pdf->SetSubject('Generardor de Reportes'); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); $pdf->setPrintHeader($parametros["PRINT_HEADER"]); $pdf->setPrintFooter($parametros["PRINT_FOOTER"]); $pdf->SetMargins($parametros["PDF_MARGIN_LEFT"], $parametros["PDF_MARGIN_TOP"], $parametros["PDF_MARGIN_RIGHT"]); $pdf->SetHeaderMargin($parametros["PDF_MARGIN_HEADER"]); $pdf->SetFooterMargin($parametros["PDF_MARGIN_FOOTER"]); $pdf->SetAutoPageBreak($parametros["AUTO_PAGE_BREAK"], $parametros["PDF_MARGIN_BOTTOM"]); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); $pdf->SetFont('helvetica', '', 6); $pdf->AddPage(); $style = array('position' => '', 'align' => 'C', 'stretch' => false, 'fitwidth' => true, 'cellfitalign' => '', 'border' => false, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => false, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4); $pdf->write1DBarcode($parametros["CODIGO_DE_BARRAS"], 'C39', 75, 278, 70, 8, 0.4, $style, 'N'); $pdf->CargarDatos($lblCabecera, $lblDetalle, $lblPie, $datosCabecera, $datosDetalle, $datosExamen, $datosExamenUni, $datosGrupo, $datosPie, $styleCL, $styleDL, $stylePL, $styleCD, $styleDD, $stylePD, $modo); $pdf->lastPage(); $pdf->Output($nombreReceta, 'I'); }
$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 = K_PATH_IMAGES . 'marcaAgua.jpg'; $pdf->SetAlpha(0.1); $pdf->Image($img_file, 0, 0, 280, 200, '', '', '', false, 300, 'C', false, false, 0); $pdf->SetAlpha(1); // restore auto-page-break status $pdf->SetAutoPageBreak($auto_page_break, $bMargin); // set the starting point for the page content $pdf->setPageMark(); } else { $pdf->write1DBarcode($CveAps, 'C128', 235, 33, 43, 13, 0.4, $style, 'N'); } if (count($comprobantes) > 0) { $tablaComprobantes = ""; for ($i = 0; $i < count($comprobantes[0]['folio']); $i++) { $tablaComprobantes .= "<tr class='mainContent'><td style='text-align:left;' class='mainContent'>" . $comprobantes[0]['folio'][$i] . "</td>" . "<td >" . $comprobantes[0]['tipoDocumento'][$i] . "</td>" . "<td >" . $comprobantes[0]['importe'][$i] . "</td>" . "<td >" . $comprobantes[0]['partida'][$i] . "</td>" . "</tr>"; } $contenido2 = <<<EOD <style> .head{background-color: #aaa7a7; text-align:center;} .titulo{font-weight: bold; font-size: 12px;} .subtitulo{font-weight: bold;} .conBorde{border: black solid 1; border-collapse:collapse; } </style> <table class="head conBorde titulo" border="1" width="100%">
// set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set font $pdf->SetFont('helvetica', '', 9); # creamos una página en blanco $pdf->Addpage(); $pdf->SetFont('helvetica', '', 9); // define barcode style $style = array('position' => 'R', 'align' => 'C', 'stretch' => 0, 'fitwidth' => 1, 'cellfitalign' => '', 'border' => 1, 'hpadding' => '2', 'vpadding' => '2', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'Helvetica', 'fontsize' => 6, 'stretchtext' => 4); $styleBC = array('position' => 'R', 'border' => 1, 'padding' => 2, 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 255), 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4); $estilo_tabla = "\r\n\t\t<style>\r\n\t\t\ttable.general {\r\n\t\t\t\tcolor: #000;\r\n\t\t\t\tfont-family: times;\r\n\t\t\t\tfont-size: 8pt;\r\n\t\t\t\tborder: 1px solid rgb(200,200,200);\r\n\t\t\t\tbackground-color: #FFF; \r\n\t\t\t} \r\n\t\t\ttd { \r\n\t\t\t\tbackground-color: #FFF; \r\n\t\t\t}\r\n\t\t\ttd.contenido {\r\n\t\t\t\tborder: 1px solid rgb(200);\r\n\t\t\t} \r\n\t\t\tth {\r\n\t\t\t\tbackground-color: rgb(230);\r\n\t\t\t\tborder: 1px solid rgb(170); \r\n\t\t\t}\r\n\t\t\t.divi {\r\n\t\t\t background-color: #b0e0e6; \r\n\t\t\t position: absolute; \r\n\t\t\tmargin-left: auto;\r\n\t\t\tmargin-right: auto; \r\n\t\t\t margin-left: 10px;\r\n\t\t\t}\r\n\t\t .center{ text-align: center; }\r\n\t\t .right { text-align: right; }\r\n\t\t .fila_0 { background-color: #FFF;}\r\n\t\t .fila_1 { background-color: rgb(240); }\r\n\t\t</style>\r\n\t\t"; $mi_estilo_tabla = "\r\n\t\t<style> \r\n th.verde {\r\n background-color: #7DAB49; \r\n }\r\n th.concepto {\r\n background-color: #BBBFBC; \r\n }\r\n td.concepto {\r\n background-color: #BBBFBC; \r\n }\r\n td.cuadro {\r\n background-color: #FFFFFF;\r\n border: 1px solid #000000; \r\n }\r\n td.renglon {\r\n background-color: #E1E0E0;\r\n }\r\n\t\t</style>\r\n\t\t"; //--------------------Contenido del reporte >--------------------------------------------------- $pdf->SetFont('times', 'L', 6); $pdf->Cell(0, 0, 'NÚMERO DE PROYECTO', 0, 1, 'R', 0, 1); $pdf->write1DBarcode($idBco, 'C39', '', '', '', 12, 0.4, $style, 'N'); $pdf->Ln(); $pdf->SetFont('times', '', 9); $pdf->Cell(0, 0, strtoupper($sTituloReporte), 0, 1, 'C', 0, 1); $pdf->Ln(2); $pdf->SetFont('times', '', 7); $pdf->Cell(160, 0, 'Número de dictamen:', 0, 0, 'R', 0, 0); $pdf->Cell(0, 0, substr($infoSol['NumDictamen'], 0, 10), 1, 1, 'R', 0, 0); $pdf->Ln(1); $pdf->SetFont('times', '', 7); $pdf->Cell(160, 0, 'Fecha de ecaluación:', 0, 0, 'R', 0, 0); $pdf->Cell(0, 0, substr($infoSol['FecReg'], 0, 10), 1, 1, 'R', 0, 0); $pdf->Ln(1); $inicio_tabla_nomProyecto = ""; $inicio_tabla_nomProyecto .= "<tr>\r\n <th width=\"155\">Nombre de la obra:</th>\r\n <td width=\"485\" class=\"contenido\">" . utf8_encode($avData['NomObr']) . "</td>\r\n </tr> \r\n\t\t\t<tr> \r\n <th width=\"155\">Descripción del proyecto:</th>\r\n <td width=\"485\" class=\"contenido\">" . utf8_encode($avData['PriCar']) . "</td>\r\n\t\t\t</tr>\r\n <tr> \r\n <th width=\"155\">Monto total de inversión:</th>\r\n <td width=\"485\" class=\"contenido\">\$" . number_format($avData['Monto'], 2) . "</td>\r\n\t\t\t</tr>\r\n <tr> \r\n <th width=\"155\">Sector:</th>\r\n <td width=\"485\" class=\"contenido\">" . utf8_encode($avData['NomSec']) . "</td>\r\n\t\t\t</tr>\r\n <tr> \r\n <th width=\"155\">Tipo de PPI:</th>\r\n <td width=\"485\" class=\"contenido\">" . utf8_encode($rPPI['NomPPI']) . "</td>\r\n\t\t\t</tr>"; foreach ($rFtes as $key => $valoresFtes) {
</tr> <tr nobr="true"> <td colspan="3"><p></p><p></p><p></p><p></p>NOMBRE Y FIRMA</td> </tr> </table> EOD; $pdf->writeHTML($tbl, true, false, false, false, ''); ob_end_clean(); $style = array('position' => '', 'align' => 'C', 'stretch' => true, 'fitwidth' => true, 'cellfitalign' => '', 'border' => false, 'hpadding' => 'auto', 'vpadding' => 'auto', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'freesans', 'fontsize' => 8, 'stretchtext' => 4); if ($marcaAgua === '1') { // 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 = K_PATH_IMAGES . 'marcaAgua.jpg'; $pdf->SetAlpha(0.1); $pdf->Image($img_file, 0, 0, 130, 300, '', '', '', false, 300, 'C', false, false, 0); // $pdf->Image($img_file, 0, 0, 0, 0, '', '', '', false, 300, '', false, false, 0); $pdf->SetAlpha(1); // restore auto-page-break status $pdf->SetAutoPageBreak($auto_page_break, $bMargin); // set the starting point for the page content $pdf->setPageMark(); } else { $pdf->write1DBarcode($idSol, 'C128', 150, 40, 70, 18, 0.4, $style, 'N'); } //Close and output PDF document $pdf->Output('SolicitudNo' . $idSol . '.pdf', 'I');