tags:

views:

43

answers:

1

Hi, I need to convert a dynamic web page to pdf... So as a start, I use this code for practice, This works fine as long as I use the directory c:/test.php. But everytime I change the directory to something like d:/xampp/htdocs/test.php I get the error message: Fatal error: Uncaught exception 'PDFlibException' with message 'pdf_begin_document() expects exactly 3 parameters, 2 given' in D:\xampp\htdocs\mypdftest\pdf_file.php:1… Stack trace: #0 D:\xampp\htdocs\mypdftest\pdf_file.php(1… pdf_begin_document(Resource id #2, 'test.pdf') #1 {main} thrown in D:\xampp\htdocs\mypdftest\pdf_file.php on line 18

Please tell me what's going wrong and how to fix it... Any help is appreciated...

A: 

Read the documentation on this one. It seems that the function pdf_begin_document() accepts 3 mandatory parameters, which are:

PDF_begin_document($pdfdoc, $filename, $optlist );

where $optlist is an option list (not much documentation here), like this example:

$optlist = "destination={page=1 type=fixed zoom=1 top=100 left=50}";
Alexander