creating pdf using pdf_new()

A

Amir

Hi
i wrote the following, which causes the script to terminate

any help is greatly appreciated,

thanks so much in advance!

=======================

<?
$pdf = pdf_new();
pdf_open_file($pdf);
pdf_set_info($pdf, "author", "test auth");
pdf_set_info($pdf, "title", "test page");
pdf_set_info($pdf, "creator", "test creator");
pdf_set_info($pdf, "subject", "Online test");
pdf_begin_page($pdf, 450, 450);

$font = pdf_findfont($pdf, "Times-Roman", "winansi",0);

pdf_setfont($pdf, $font, 12);
pdf_show_xy($pdf, "test text", 5, 20);

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: inline; filename=test.pdf");

echo $buffer;
pdf_delete($pdf);

?>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top