I don't usually consider myself a newebie on much of the php programming stuff, 'cause I've done it for several years now, but...
...Yesterday I found out I was going to set up one of my web-pages so that it could generate not only printable pages, but printable pages in pfd format. (easy to save, etc etc)
so, today I contacted the guys whom host my server, and they installed PDFlib for me...
buuuuuut...
I tried the sample script from php.net (follows below) and all I get is an "call to undefined" error.
can someone please direct me unto what I'm supposed to do?
<?php
$p = PDF_new();
/* open new PDF file; insert a file name to create the PDF on disk */
if (PDF_begin_document($p, "", "") == 0) {
die("Error: " . PDF_get_errmsg($p));
}
PDF_set_info($p, "Creator", "hello.php");
PDF_set_info($p, "Author", "Rainer Schaaf");
PDF_set_info($p, "Title", "Hello world (PHP)!");
PDF_begin_page_ext($p, 595, 842, "");
$font = PDF_load_font($p, "Helvetica-Bold", "winansi", "");
PDF_setfont($p, $font, 24.0);
PDF_set_text_pos($p, 50, 700);
PDF_show($p, "Hello world!");
PDF_continue_text($p, "(says PHP)");
PDF_end_page_ext($p, "");
PDF_end_document($p, "");
$buf = PDF_get_buffer($p);
$len = strlen($buf);
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=hello.pdf");
print $buf;
PDF_delete($p);
?>
and the error is on line two, the php_new thing, I tried to open an already existing document, with the pdf_open tag, but that didn't produce anything but the same result...