Hi all, ive been trying to get to grips with the PDF library but i keep getting the following errors. im trying to put the pdf to the browser and not save it on the drive.
Warning: pdf_open_file() expects exactly 2 parameters, 1 given in C:\Programs\Apache Group\Apache2\htdocs\themodem.mine.nu4\random\pdf. php on line 17
Fatal error: pdf_begin_page(): [2100] PDF_begin_page: Function must not be called in 'object' scope in C:\Programs\Apache Group\Apache2\htdocs\themodem.mine.nu4\random\pdf. php on line 23
heres the code im using
PHP Code:
$pdf = pdf_new();
pdf_open_file($pdf);
pdf_set_info($pdf, "author", "Themodem");
pdf_set_info($pdf, "title", "Test");
pdf_set_info($pdf, "subject", "Test Script");
pdf_begin_page($pdf, 450, 450);
$font = pdf_findfont($pdf, "Helvetica-Bold", "winansi",0);
pdf_setfont($pdf, $font, 12);
pdf_show_xy($pdf, "Themodem", 5, 225);
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=zend.pdf");
pdf_delete($pdf);
can anyone see any problems?
Cheers Lee
|