Dear all
I want to convert a text file to pdf format and store it in somewhere in my
harddisk.
I had found out that there is a dll inside my php4.04 directory
("c:\php\extensions\php_pdf.dll") and from php.ini i had check that the
extension_dir=c:\php\extensions;
extension=php_pdf.dll had actived;
now i obtained a simple script from the net, and tried to test it , but it
return alot of errors!
Here is the testing script :
<?php
dl("php_pdf.dll");
# $Id: hello.php,v 1.9 2003/03/14 17:07:56 rp Exp $
/* create a new PDFlib object */
$p = PDF_new();
/* open new PDF file; insert a file name to create the PDF on disk */
PDF_open_file($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($p, 595, 842); /* start a new page */
$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($p); /* close page */
PDF_close($p); /* close PDF document */
$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); /* delete the PDFlib object */
?>
and here is the error message i got when i ran the script :
X-Powered-By: PHP/4.0.4pl1 Content-type: text/html
Warning: Function registration failed - duplicate name - pdf_set_info in
C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 2
Warning: Function registration failed - duplicate name -
pdf_set_info_creator in C:\InetPub\wwwroot\Nedcor Internal
Live\test\hello.php on line 2
Warning: Function registration failed - duplicate name - pdf_set_info_title
in C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 2
Warning: Function registration failed - duplicate name -
pdf_set_info_subject in C:\InetPub\wwwroot\Nedcor Internal
Live\test\hello.php on line 2
Warning: pdf: Unable to register functions, unable to load in Unknown on
line 0
Fatal error: Call to undefined function: pdf_new() in
C:\InetPub\wwwroot\Nedcor Internal Live\test\hello.php on line 6
PHP Warning: Unable to load dynamic library
'c:\php\extensions/libpdf_php.dll' - The specified procedure could not be
found. in Unknown on line 0
Can anyone seens this before? if so, could you please give me some hints how
i can convert a text file to pdf file under windows environment?
Thx alot
Jack
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php