phppdflib.class
Posted: Tue Jul 27, 2004 4:36 pm
can someoen help me with this. I have a script written using it and it pulls info from my database and displays it the way I want but I am not sure how to deal with multiple returns,
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$result = mysql_query("...."); //returns more than one row
while($row = mysql_fetch_assoc($result)){
echo $row['field'];
}Code: Select all
<?php
require('../phppdflib.class.php');
$pdf = new pdffile;
$pdf->set_default('margin', 0);
$param["height"] = 12;
$param["font"] = "Times-Italic";
$firstpage = $pdf->new_page("5x3in");
$pdf->draw_rectangle( 198, 18, 18, 342, $firstpage, $param);
$pdf->draw_text(150, 100, "Page #1", $firstpage, $param);
$secondpage = $pdf->new_page("5x3in");
$pdf->draw_rectangle( 198, 18, 18, 342, $secondpage, $param);
$pdf->draw_text(150, 100, "Page #2", $secondpage, $param);
$thirdpage = $pdf->new_page("5x3in");
$pdf->draw_rectangle( 198, 18, 18, 342, $thirdpage, $param);
$pdf->draw_text(150, 100, "Page #3", $thirdpage, $param);
$fourthpage = $pdf->new_page("5x3in");
$pdf->draw_rectangle( 198, 18, 18, 342, $fourthpage, $param);
$pdf->draw_text(150, 100, "Page #4", $fourthpage, $param);
header("Content-Disposition: filename=example.pdf");
header("Content-Type: application/pdf");
$temp = $pdf->generate();
header('Content-Length: ' . strlen($temp));
echo $temp;
?>