Page 1 of 1

help please.. create pdf file from php code

Posted: Tue Dec 16, 2008 5:52 am
by falcons
hello dear friends ... .
i need a help for creating pdf file from php code with mysql database
i found soem code from net ... but that is not run return me error ..

<?php
$mypdf = pdf_new();
pdf_open_file($mypdf, "riz.pdf");
pdf_begin_page($mypdf, 595, 842);
$myfont = pdf_findfont($mypdf, "Times-Roman", "host", 0);
pdf_setfont($mypdf, $myfont, 10);
pdf_show_xy($mypdf, "There are more things in heaven and earth, Horatio,", 50, 750);
pdf_show_xy($mypdf, "than are dreamt of in your philosophy", 50, 730);
pdf_end_page($mypdf);
pdf_close($mypdf);
pdf_delete($mypdf);
?>


this code return me error ...
Fatal error: Call to undefined function pdf_new() in c:\wamp\www\exemples\phpinfo1.php on line 2

help me please what i will do ...

Re: help please.. create pdf file from php code

Posted: Tue Dec 16, 2008 6:20 am
by The_Anomaly
On the manual it says:
PECL pdflib:1.0-2.1.3
Do you have the PECL extension for PDFlib installed? That would certainly explain PHP not recognizing the pdf_new() function.

EDIT: And please remember to use the code=php tags. It makes the posts look a lot cleaner.

Re: help please.. create pdf file from php code

Posted: Tue Dec 16, 2008 6:42 am
by falcons
thanks dear for reply
dear what is PECL extension and how its use?

Re: help please.. create pdf file from php code

Posted: Tue Dec 16, 2008 6:46 am
by The_Anomaly

Re: help please.. create pdf file from php code

Posted: Tue Dec 16, 2008 7:18 am
by falcons
The_Anomaly wrote:Well, "Dear," Google Is Your Best Friend.

dear PECL pdflib:1.0-2.1.3 is a paid version .. ... do you have or know any free version