|
Posted by Pasquale on 09/28/87 11:42
With my host upgrading their PHP version to 4.4.2. I had to put the
filename parameter in the pdf_open_file(). In doing so, the PDF does not
come up for download now.
Can someone please let me know what I need to do with the last few lines
or so to get it to work?
Thanks.
<?php
$pdf = pdf_new();
pdf_open_file($pdf, "pdfs/pdftest3.pdf");
pdf_set_info($pdf, "author", "Pasquale");
pdf_set_info($pdf, "title", "Test for PHP PDF");
pdf_set_info($pdf, "subject", "Testing");
pdf_begin_page($pdf, 400, 500);
$font = pdf_findfont($pdf, "Helvetica-Bold", "winansi",0);
pdf_setfont($pdf, $font, 10);
pdf_show_xy($pdf, "This is a test.", 5, 300);
pdf_end_page($pdf);
pdf_close($pdf);
$buffer = pdf_get_buffer($pdf);
header( "Content-type: application/pdf" );
header("Content-Length: ".strlen($buffer));
header( "Content-Disposition: attachment; filename=pdfs/pdftest3.pdf" );
echo $buffer;
pdf_delete($pdf);
?>
Navigation:
[Reply to this message]
|