note 11522 deleted from ref.pdf by didou
| From: | didou@php.net | Date: | Sat, 09 Aug 2003 03:27:31 +0000 |
| Subject: | note 11522 deleted from ref.pdf by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53724@lists.php.net to get a copy of this message | ||
Note Submitter: pete@SoulCoffee.org
----
I added the manually patched the file, configured with ./configure --enable-shared-pdflib and
nothing else, and used this modification of the php page shown above:
<?
header( "Content-type: application/x-pdf" );
$f = fopen("/tmp/test", "w");
$pdf = PDF_open($f);
//$pdf = PDF_new();
PDF_set_info_author($pdf, "Luca Perugini");
PDF_set_info_title($pdf, "Brochure for FlyStore");
PDF_set_info_creator($pdf, "See Author");
PDF_set_info_subject($pdf, "FlyStore");
PDF_begin_page($pdf, 595, 842);
PDF_add_outline($pdf, "Item".$data[1]);
PDF_set_font($pdf, "Helvetica-Bold" , 20, winansi);
PDF_set_text_rendering($pdf, 0);
PDF_show_xy($pdf, "OMG its a pdf on the fly!",50,780);
if (!isset($name)) {
$name = "Test Name";
}
if (!isset($age)) {
$age = "Test Age";
}
PDF_show_xy($pdf, "Your Name : $name" .$data[1], 100, 700);
PDF_show_xy($pdf, "Age : $age" .$data[2], 100, 620);
PDF_stroke($pdf);
PDF_end_page($pdf);
PDF_close($pdf);
fclose($f);
header("Content-length: " . filesize("test"));
$f = fopen("/tmp/test", "r");
fpassthru($f);
fclose($f);
?>
Only then did it work for me.