// Image
 #ezImage(image,[padding],[width],[resize],[justification],[array border]);
 #$pdf->addPngFromFile($pathvars["fileroot"]."/images/net/wappen.png",20,780,70);
 #$pdf->addPngFromFile($pathvars["fileroot"]."/images/net/auge.png",500,780,70);
 $pdf->addPngFromFile($pathvars["fileroot"] . "/images/net/kleines-wappen.png", 30, 780, 46);
 $pdf->addPngFromFile($pathvars["fileroot"] . "/images/net/auge.png", 300, 780, 70);
 // eine linie
 $pdf->line(20, 770, 560, 770);
 $pdf->addText(120, 790, '20', '<b>Vermessungsamt</b>');
 $pdf->addText(380, 790, '20', '<i>Friedberg</i>');
 // seiten nummern
 $pdf->ezStartPageNumbers(300, 20, 12, '', '', 1);
 // hier geht es los
 $pdf->ezSetDy(-60);
 // spaltenweise ausgabe an
 $pdf->ezColumnsStart(array("num" => 2, "gap" => 20));
 // wichtig: damit der die ausgabe am spaltenbeginn steht
 #$pdf->ezSetDy(10);
 // Textblock
 #$pdf->ezText($text,10,array( "justification" => "full" )); // "leading"=>20, "spacing"=>1
 // Tabellen
 $data = array(array('num' => 1, 'name' => 'gandalf', 'type' => 'wizard'), array('num' => 2, 'name' => 'bilbo', 'type' => 'hobbit', 'url' => 'http://www.ros.co. nz/pdf/'), array('num' => 3, 'name' => 'frodo', 'type' => 'hobbit'), array('num' => 4, 'name' => 'saruman', 'type' => 'bad dude', 'url' => 'http://sourceforge.net/projects/pdf-php'), array('num' => 5, 'name' => 'sauron', 'type' => 'really bad dude'));
 for ($i = 0; $i <= 20; $i++) {
     $pdf->ezTable($data, '', '', array("fontSize" => 9, "width" => 260));
 }
 // umbruch
 $pdf->ezSetDy(-10);
 // Textblock
 #$pdf->ezText($text,10,array( "justification" => "full" )); // "leading"=>20, "spacing"=>1
 // spaltenweise ausgabe aus
 $pdf->ezColumnsStop();
Ejemplo n.º 2
0
 public function pdfObjectnames($result)
 {
     global $instDir;
     $page = 1;
     $i = 0;
     $result = $this->sortResult($result);
     while (list($key, $valueA) = each($result)) {
         $obs1[] = array($valueA['showname']);
     }
     // Create pdf file
     $pdf = new Cezpdf('a4', 'landscape');
     $pdf->ezStartPageNumbers(450, 15, 10);
     $pdf->selectFont($instDir . 'lib/fonts/Helvetica.afm');
     $pdf->ezText(utf8_decode(html_entity_decode($_GET['pdfTitle'])), 18);
     $pdf->ezColumnsStart(array('num' => 10));
     $pdf->ezTable($obs1, '', '', array("width" => "750", "cols" => array(array('justification' => 'left', 'width' => 80)), "fontSize" => "7", "showLines" => "0", "showHeadings" => "0", "rowGap" => "0", "colGap" => "0"));
     $pdf->ezStream();
 }
Ejemplo n.º 3
0
$pwidth = $pdf->ez['pageWidth'];
$xpos = round(($pwidth - $pdf->getTextWidth(12, $doc_title)) / 2, 2);
$pdf->addText($xpos, $ypos, 12, $doc_title);
$pdf->selectFont("{$font_dir}/Helvetica.afm");
$date = new w2p_Utilities_Date();
$xpos = round($pwidth - $pdf->getTextWidth(10, $date->format($df)) - $pdf->ez['rightMargin'], 2);
$doc_date = strEzPdf($date->format($df));
$pdf->addText($xpos, $ypos, 10, $doc_date);
$pdf->closeObject($page_header);
$pdf->addObject($page_header, 'all');
$gpdfkey = W2P_BASE_DIR . '/modules/tasks/images/ganttpdf_key.png';
$gpdfkeyNM = W2P_BASE_DIR . '/modules/tasks/images/ganttpdf_keyNM.png';
$pdf->ezStartPageNumbers(802, 30, 10, 'left', 'Page {PAGENUM} of {TOTALPAGENUM}');
for ($i = 0; $i < count($ganttfile); $i++) {
    $gf = $ganttfile[$i];
    $pdf->ezColumnsStart(array('num' => 1, 'gap' => 0));
    $pdf->ezImage($gf, 0, 765, 'width', 'left');
    // No pad, width = 800px, resize = 'none' (will go to next page if image height > remaining page space)
    if ($showNoMilestones == '1') {
        $pdf->ezImage($gpdfkeyNM, 0, 765, 'width', 'left');
    } else {
        $pdf->ezImage($gpdfkey, 0, 765, 'width', 'left');
    }
    $pdf->ezColumnsStop();
}
// End of project display
// Create document body and pdf temp file
$pdf->stopObject($page_header);
$gpdffile = $temp_dir . '/GanttChart_' . md5(time()) . '.pdf';
if ($fp = fopen($gpdffile, 'wb')) {
    fwrite($fp, $pdf->ezOutput());