Beispiel #1
0
// set header and footer fonts
$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
//-----------------------------
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(10, 19, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetAutoPageBreak(true, 0);
// set auto page breaks
//    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set font
$pdf->SetFont('helvetica', '', 6.5);
$pdf->Addpage();
$pdf->writeHTML($contenido, true, false, false, false, '');
if ($marcaAgua === '1') {
    // get the current page break margin
    $bMargin = $pdf->getBreakMargin();
    // get current auto-page-break mode
    $auto_page_break = $pdf->getAutoPageBreak();
    // 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);
Beispiel #2
0
$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
//-----------------------------
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(15, 30, 15);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set font
$pdf->SetFont('helvetica', '', 9);
# creamos una página en blanco
$pdf->Addpage();
$pdf->SetFont('helvetica', '', 9);
// define barcode style
$style = array('position' => 'R', 'align' => 'C', 'stretch' => 0, 'fitwidth' => 1, 'cellfitalign' => '', 'border' => 1, 'hpadding' => '2', 'vpadding' => '2', 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'text' => true, 'font' => 'Helvetica', 'fontsize' => 6, 'stretchtext' => 4);
$styleBC = array('position' => 'R', 'border' => 1, 'padding' => 2, 'fgcolor' => array(0, 0, 0), 'bgcolor' => array(255, 255, 255), 'text' => true, 'font' => 'helvetica', 'fontsize' => 8, 'stretchtext' => 4);
$estilo_tabla = "<style>\r\n    .tablaFicha{\r\n        width: 100%;\r\n        font-size: 10px;        \r\n    }\r\n    .celdaTablaFicha{\r\n        border: 1px solid #CCCCCC;\r\n        vertical-align: middle;\r\n    }\r\n    .fecha{\r\n        text-align: right;\r\n    }\r\n    .encabezado{\r\n        background-color: #EFEFEF;\r\n    }\r\n</style>";
$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 &Uacute;TIL DEL PROYECTO:</td>\r\n        <td class=\"celdaTablaFicha\">" . utf8_encode($infoBcoPDF['vidaPry']) . " A&Ntilde;OS</td>\r\n        <td class=\"celdaTablaFicha encabezado\" colspan=\"2\">MONTO TOTAL DE INVERSI&Oacute;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>";
Beispiel #3
0
}
td.bordeAbajoTd2{
    border-bottom: 1px solid black;        
}        
td.titUe{
    height: 20px;        
    font-size: 10px;
    font-weight: bold;    
}  
</style>        
{$contenidopag2}
EOF;
    $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    $pdf->AddPage();
    $pdf->writeHTML($contenido1, true, false, false, false, '');
    if ($contenido2 != "") {
        $pdf->Addpage('L');
        $pdf->writeHTML($contenido2, true, false, false, false, '');
    }
    ob_end_clean();
    $pdf->Output('Oficio' . $dataOfi['CveOfi'] . '.pdf', 'I');
} else {
    header(':', true, 404);
    header('X-PHP-Response-Code: 404', true, 404);
    echo $error_code = "<h1>403 - Forbidden</h1>";
    echo $explanation = "<h3>This section requires a password or is otherwise protected.</h3>";
}
?>