function HeaderLogo($jdl, $p, $orientation = 'P', $jdltambahan = '')
{
    $pjg = 120;
    $top = 800;
    $logo = file_exists("../img/logo.jpg") ? "../img/logo.jpg" : "img/logo.jpg";
    $identitas = GetFields('identitas', 'Kode', KodeID, 'Nama, Alamat1, Telepon, Fax');
    //$fp = fopen($logo, 'rb');
    //$data = fread($fp, filesize($logo));
    //$p->addImage($data, 12, 8, 18);
    //$p->imagecreatefrom png($logo);
    $img = ImageCreatefromjpeg($logo);
    $p->addImage($img, 30, 765, 65);
    $p->AddText($pjg, $top, 10, $identitas['Yayasan']);
    $p->AddText($pjg, $top, 12, $identitas['Nama']);
    //Judul
    if ($orientation == 'L') {
        $p->AddText($pjg + 20, $top, 16, $jdl);
    } else {
        $p->AddText($pjg + 300, $top, 12, $jdl);
    }
    $p->AddText($pjg, $top - 12, 8, $identitas['Alamat1']);
    if ($orientation == 'L') {
        $p->AddText($pjg + 20, $top - 12, 18, $jdltambahan);
    } else {
        $p->AddText($pjg + 80, $top - 12, 14, $jdltambahan);
    }
    $p->AddText($pjg, $top - 24, 8, "Telp. " . $identitas['Telepon'] . ", Fax. " . $identitas['Fax']);
    if ($orientation == 'L') {
        $length = 775;
    } else {
        $length = 575;
    }
    $p->line(20, $top - 40, $length, $top - 40);
}
require_once "../ConectarSolo.php";
$l = Conectarse("webpmm");
ini_set('post_max_size', '512M');
ini_set('upload_max_filesize', '512M');
ini_set('memory_limit', '500M');
ini_set('max_execution_time', 600);
ini_set('limit', -1);
include 'class.ezpdf.php';
$pdf = new Cezpdf('LETTER', 'portrait');
#					 t, b, l, r
$pdf->ezSetMargins(50, 70, 50, 50);
#w = 612 h = 792
$pdf->setColor(0.16, 0.38, 0.61);
$pdf->selectFont('fonts/Helvetica.afm');
$img = ImageCreatefromjpeg('../img/logo.jpg');
$pdf->addImage($img, 50, 697, 47, 50);
$pdf->addText(110, 722, 24, '<b>ENTREGAS PUNTUALES</b>');
$pdf->setColor(0.79, 0.67, 0.11);
$pdf->addText(110, 702, 16, '<b>Soporte de Factura ' . $_GET[folio] . '</b>');
$pdf->line(50, 690, 560, 690);
$pdf->setColor(0.25, 0.25, 0.25);
$pdf->ezText("\n\n\n\n{$f->fechaactual}", 12, array('justification' => 'right'));
#detallado superior
$s = "SELECT fd.*,SUBSTRING(CONCAT(cc.nombre,' ',cc.paterno,' ',cc.materno),1,25) cliente,gv.totalpaquetes,\n\t\tDATE_FORMAT(fd.fecha,'%d/%m/%Y') AS fecha\n\t\tFROM facturadetalle fd\n\t\tINNER JOIN guiasventanilla gv ON fd.folio=gv.id\n\t\tINNER JOIN catalogocliente cc ON gv.iddestinatario=cc.id\n\t\tWHERE fd.factura = '{$_GET['folio']}'\n\t\tUNION\n\t\tSELECT fd.*,SUBSTRING(CONCAT(cc.nombre,' ',cc.paterno,' ',cc.materno),1,25) cliente,ge.totalpaquetes,\n\t\tDATE_FORMAT(fd.fecha,'%d/%m/%Y') AS fecha\n\t\tFROM facturadetalle fd\n\t\tINNER JOIN guiasempresariales ge ON fd.folio=ge.id\n\t\tINNER JOIN catalogocliente cc ON ge.iddestinatario=cc.id\n\t\tWHERE fd.factura = '{$_GET['folio']}'";
$rx = mysql_query($s, $l) or die($s);
$registros = mysql_num_rows($rx);
if ($registros > 0) {
    $pdf->setColor(0.79, 0.67, 0.11);
    $pdf->ezText("<b>DETALLADO DE FACTURA, GUIAS</b>\n", 12, array('justification' => 'left'));
    $pdf->setColor(0.25, 0.25, 0.25);
Ejemplo n.º 3
0
    $pdf->addText($x, $y - $th - $td, $ts, $text);
    $pdf->setColor(0.6, 0, 0);
    $pdf->addText($x, $y - $th - $td, $ts * 0.1, 'http://www.ros.co.nz');
    $pdf->restoreState();
    return $height;
}
//ros_logo($pdf,150,$pdf->y-100,80,150,200);
$pdf->selectFont($mainFont);
if (file_exists('ros.jpg')) {
    $pdf->addJpegFromFile('ros.jpg', 199, $pdf->y - 100, 200, 0);
} else {
    // comment out these two lines if you do not have GD jpeg support
    // I couldn't quickly see a way to test for this support from the code.
    // you could also copy the file from the locatioin shown and put it in the directory, then
    // the code above which doesn't use GD will be activated.
    $img = ImageCreatefromjpeg('http://www.ros.co.nz/pdf/ros.jpg');
    $pdf->addImage($img, 199, $pdf->y - 100, 200, 0);
}
//-----------------------------------------------------------
// load up the document content
$data = file('./data.txt');
// try adding the faq's to the document, this will not work for people re-building the file from the
// download as I am not going to put in the faq file with that
$faqFile = '../ros/pdf/faqs.inc';
if (file_exists($faqFile)) {
    // then the file is there.
    $data[] = "#NP\n";
    $data[] = "1<FAQs>\n";
    include $faqFile;
    foreach ($faqs as $v) {
        $data[] = "2<" . $v['t'] . ">\n";