help please.. create pdf file from php code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
falcons
Forum Newbie
Posts: 16
Joined: Mon Nov 10, 2008 8:00 am

help please.. create pdf file from php code

Post 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 ...
User avatar
The_Anomaly
Forum Contributor
Posts: 196
Joined: Fri Aug 08, 2008 4:56 pm
Location: Tirana, Albania

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

Post 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.
falcons
Forum Newbie
Posts: 16
Joined: Mon Nov 10, 2008 8:00 am

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

Post by falcons »

thanks dear for reply
dear what is PECL extension and how its use?
User avatar
The_Anomaly
Forum Contributor
Posts: 196
Joined: Fri Aug 08, 2008 4:56 pm
Location: Tirana, Albania

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

Post by The_Anomaly »

falcons
Forum Newbie
Posts: 16
Joined: Mon Nov 10, 2008 8:00 am

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

Post 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
Post Reply