phppdflib.class
Moderator: General Moderators
phppdflib.class
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,
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
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;
?>not sure if I am making any sense
not sure how to explain this
i know this is not ever close to anything being correct but maybe it will help explain what i am wanting to do
$result = @mysql_query($sql,$connection)
or die("Couldn't execute query.");
while ($row = mysql_fetch_array($result)) {
;
}
$display_block .= "
$page = $pdf->new_page("5x3in");
$pdf->draw_rectangle( 198, 18, 18, 342, $page, $param);
$pdf->draw_text(150, 100, "Page #?", $page, $param);
";
}
print(
<?php
require('../phppdflib.class.php');
$pdf = new pdffile;
$pdf->set_default('margin', 0);
$param["height"] = 12;
$param["font"] = "Times-Italic";
<? echo "$display_block"; ?>
header("Content-Disposition: filename=example.pdf");
header("Content-Type: application/pdf");
$temp = $pdf->generate();
header('Content-Length: ' . strlen($temp));
echo $temp;
?>
);
$result = @mysql_query($sql,$connection)
or die("Couldn't execute query.");
while ($row = mysql_fetch_array($result)) {
;
}
$display_block .= "
$page = $pdf->new_page("5x3in");
$pdf->draw_rectangle( 198, 18, 18, 342, $page, $param);
$pdf->draw_text(150, 100, "Page #?", $page, $param);
";
}
print(
<?php
require('../phppdflib.class.php');
$pdf = new pdffile;
$pdf->set_default('margin', 0);
$param["height"] = 12;
$param["font"] = "Times-Italic";
<? echo "$display_block"; ?>
header("Content-Disposition: filename=example.pdf");
header("Content-Type: application/pdf");
$temp = $pdf->generate();
header('Content-Length: ' . strlen($temp));
echo $temp;
?>
);