Click here to Skip to main content
15,747,766 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all i need to create a report in php using pdf
As i am new to php first i have written a simple program to open a pdf
$pdf = pdf_new();  
pdf_open_file($pdf, "philosophy.pdf");  
pdf_begin_page($pdf, 595, 842);  
$arial = pdf_findfont($pdf, "Arial", "host", 1); pdf_setfont($pdf, $arial, 10); pdf_show_xy($pdf, "There are more things in heaven and earth, Horatio,", 50, 750);
pdf_show_xy($pdf, "than are dreamt of in your philosophy", 50, 730);  

But i am getting error as call to undefined function pdf_new(). How to solve this?
Pls help.

1 solution

Hello friend,

Please use html2pdf for converting html to pdf. It is so simple to use it. You can find the sample code here
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900