Im following a php book trying to create PDF's
Fatal error: Call to undefined function: pdf_new() in /home/user/public_html/invoicepdf.php on line 9
my code direct from the book
<?php
// PDF Generation
// Set constants and variables
define ("PAGE_WIDTH", 612); // 8.5inch
define ("PAGE_HEIGHT",792); // 11 inch
// Generate Invoice
$pdf = pdf_new();
pdf_open_file ($pdf, "");
//Set the Different PDF Values
pdf_set_info ($pdf, "Author", "David");
pdf_set_info ($pdf, "Title", "Invoice For" . $HTTP_POST_VARS['client']);
pdf_set_info ($pdf, "Creator", "See Author");
// Create the Page
pdf_begin_page($pdf, PAGE_WIDTH, PAGE_HEIGHT);
// Finish PDF
pdf_end_page ($pdf);
// Close PDF
pdf_close ($pdf);
// Send the PDF to the browser
$buffer = pdf_get_buffer ($pdf);
header ("Content-type:application/pdf");
header ("Content-Length: " . strlen($buffer));
header ("Content-Disposition: inline; filename=invoice18112005.pdf");
echo $buffer;
// free resources
pdf_delete ($pdf);
?>
Anything obviosly wrong with it?
David