$pdf->draw_rectangle(400, 150, 150, 300, $page);
$pdf->set_default('fillcolor', $pdf->get_color('green'));
$space = new field(400, 600, 600, 800);
$pdf->packer->allocate($space);
$pdf->draw_rectangle(800, 400, 600, 600, $page);
$pdf->set_default('fillcolor', $pdf->get_color('black'));
$pdf->set_default('height', 10);
$text = implode('', file('text.txt'));
$pdf->packer->fill_text($text);
$pdf->set_default('smode', 'stroke');
$pdf->set_default('strokecolor', $pdf->get_color('#cccccc'));
foreach ($pdf->packer->fields as $f) {
    $pdf->draw_rectangle($f->t, $f->l, $f->b, $f->r, $page);
    $x[0] = $f->l;
    $x[1] = $f->r;
    $y[0] = $f->b;
    $y[1] = $f->t;
    $pdf->draw_line($x, $y, $page);
}
$page = $pdf->new_page();
$pdf->set_default('height', 9);
$pdf->draw_paragraph(720, 72, 72, 540, $pdf->_print_r($pdf->packer->fields), $page);
/* These headers do a good job of convincing most
 * browsers that they should launch their pdf viewer
 * program
 */
header("Content-Disposition: filename=example.pdf");
header("Content-Type: application/pdf");
$temp = $pdf->generate(0);
header('Content-Length: ' . strlen($temp));
echo $temp;
         $nom_adh_ext .= _T("Miss.");
         break;
     case "4":
         $nom_adh_ext .= _T("Society");
         break;
     default:
         $nom_adh_ext .= "";
 }
 $x1 = $xorigin + ($col - 1) * (round(PREF_ETIQ_HSIZE * 2.835) + round(PREF_ETIQ_HSPACE * 2.835));
 $x2 = $x1 + round(PREF_ETIQ_HSIZE * 2.835);
 $y1 = $yorigin - ($row - 1) * (round(PREF_ETIQ_VSIZE * 2.835) + round(PREF_ETIQ_VSPACE * 2.835));
 $y2 = $y1 - round(PREF_ETIQ_VSIZE * 2.835);
 $nom_adh_ext .= " " . strtoupper($resultat->fields[1]) . " " . ucfirst(strtolower($resultat->fields[2]));
 $concatname = $concatname . " - " . $nom_adh_ext;
 $param["font"] = "Helvetica-Bold";
 $pdf->draw_paragraph($y1 - 10, $x1, $y1 - 10 - round(PREF_ETIQ_VSIZE * 2.835) / 5 + 5, $x2, $nom_adh_ext, $firstpage, $param);
 $param["font"] = "Helvetica";
 $pdf->draw_paragraph($y1 - 10 - round(PREF_ETIQ_VSIZE * 2.835) / 5, $x1, $y1 - 10 - round(PREF_ETIQ_VSIZE * 2.835) / 5 - round(PREF_ETIQ_VSIZE * 2.835) * 4 / 5, $x2, $resultat->fields[3] . "\n" . $resultat->fields[8] . "\n" . $resultat->fields[5] . "  -  " . $resultat->fields[6] . "\n" . $resultat->fields[7], $firstpage, $param);
 $pdf->draw_rectangle($y1, $x1, $y2, $x2, $firstpage, $param);
 $resultat->MoveNext();
 $col++;
 if ($col > PREF_ETIQ_COLS) {
     $col = 1;
     $row++;
 }
 if ($row > PREF_ETIQ_ROWS) {
     $col = 1;
     $row = 1;
     $firstpage = $pdf->new_page("a4");
 }
 $nb_etiq++;
示例#3
0
$pdf->draw_rectangle(792, 0, 792 - 75, 612, $firstpage, $p);
$param["height"] = 32;
$param["font"] = "Times-Bold";
$param["mode"] = "fill+stroke";
$param['fillcolor']["red"] = 0;
$param['fillcolor']["blue"] = 0;
$param['fillcolor']["green"] = 0.5;
$param['strokecolor']["red"] = 0;
$param['strokecolor']["blue"] = 0;
$param['strokecolor']["green"] = 0;
$pdf->draw_text(70, 680, "Dynamically generated PDF files", $firstpage, $param);
$text = <<<EOT
Dynamically generated PDF files can enhance your website by making it more interesting and useful to your target audience.  Any time you want to deliver a print-ready document across the Internet, the PDF format is the correct delivery medium.  Whether it be downloadable or emailed, a document in PDF format is virtually guaranteed to display and print properly on any computer.
HTML can't promise this, and neither can proprietary formats, such as Word or Wordperfect documents.
EOT;
$pdf->draw_paragraph(660, 50, 300, 380, $text, $firstpage);
$pdf->draw_rectangle(650, 450, 600, 500, $firstpage, array('mode' => 'stroke'));
$x[0] = 53;
$x[1] = 503;
$x[2] = 303;
$y[0] = 447;
$y[1] = 567;
$y[2] = 347;
unset($p);
$p['mode'] = 'fill';
$p['fillcolor']['red'] = $p['fillcolor']['green'] = $p['fillcolor']['blue'] = 0.4;
$pdf->draw_line($x, $y, $firstpage, $p);
$x[0] = 50;
$x[1] = 500;
$x[2] = 300;
$y[0] = 450;