Hello Everyone,
How do I create a PDF file in PHP that contains the following text "Testing Testing 1,2,3!!!"?
Many Thanks,
| SitePoint Sponsor |


Hello Everyone,
How do I create a PDF file in PHP that contains the following text "Testing Testing 1,2,3!!!"?
Many Thanks,



Documentation @ : http://us2.php.net/pdf
Computers and Fire ...
In the hands of the inexperienced or uneducated,
the results can be disastrous.
While the professional can tame, master even conquer.
If you want to use the pre-built libraries then go for some:
http://www.digitaljunkies.ca dompdf which converts html tags to pdf so it is called HTML2PDF too. Also you can use ezpdf class which also does the almost same task. Go to in the http://www.phpclasses.org/ and do make a search there with the keyword ezpdf.
And of course if you want to go through yourself then you can use PHP's library http://www.php.net/pdf
Good luck.

Another one to look at is FPDF
http://www.fpdf.org/
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">


felgall,
I tried this one before, how do I install it?
Many Thanks,

All I did to install it was to copy the fpdf.php file to my server, add an include statement at the top of the pages where I wanted to use it, and then call the functions as required to generate the content for the file where I wanted it.
The only point where the install became more complex was where I wanted to start using a specific non-standard font for part of the content where I then had to do additional processing to generate the font file in the correct format to use with it.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">




Rajug,
How do I install/use PHP's PDF library http://www.php.net/pdf?
What do I need to do to setup?
If you are having PHP5 or upper version, it must be bundled with it just you have to uncomment it in php.ini. Otherwise search for the library and download and put it in the extension directory and it will work when you re-start your web server.


Best class to use is TCPDF. Why? It supports Unicode (PDFLib also, but i is not free, I mean completely free and requires to be installed on atarged hosting) and it's better to use thing you can extend in the future. If you don't need Unicode now, are you sure you will not need it forever. And once you need it, you'll come to conclusion that you need TCPDF or install PDFLib on some hosting. And not all hostings support PDFLib and not all hosting allow you to install your programs.
My advice - use TCPDF.





the best is http://www.ros.co.nz/pdf/ i have been using it on simple pdf to complex legal forms. try this its free. AND I CAN BET THAT YOU CAN'T GET ANY THING BETTER !! BECAUSE FOR SOME WORKS, I TRIED MANY php PDFS TOOLS AND CLASSES, EVEN I BOUGHT SOME.


zeeshanhashmi,
How do I install/use http://www.ros.co.nz/pdf/
What do I need to do to setup?



If YOU ACTUALLY READ the page:
"The file readme.pdf contains all of the documentation, it serves triple purpose as the demo file and the testscript. The class download contains everything that you will need to produce this file."
**** READ THE PDF FILE ****![]()





yes, and u do not need to INSTALL anything. Just put the class file (2 PHP files) in the same folder where your PDF script will reside. then simply use
include 'php_pdf_class_name.php';
and use that as per the documentation.
Cheers !


Terrific!!!
Can I just ask one question?
If you were to use PHP's Built-in PDF Creator, would you need to include a file at the top of the code in order to get it working (Like http://www.ros.co.nz/pdf/) As I tried the built-in PDF creator previously, and couldn't get it to work. Do you have any knowledge why?


How do I display data from a database in a PDF? How do I adapt the following?
Code:<?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $result = mysql_query("SELECT * FROM person"); while($row = mysql_fetch_array($result)) { echo $row['FirstName'] . " " . $row['LastName']; echo "<br />"; } mysql_close($con); ?>



You don't.
It's apparent you have absolute no capability to listen to advice given time and time again across multiple similar posts.
You also appear to have no desire to actually learn, you just want somebody to do all the work for you.
I'd suggest that you pay somebody to modify scripts for you, as it would appear that programming is not something suited to your mindset.
been looking for a pdf solution for a while now. I wonder if some of you could help me.
I used fpdf -> it doesn't work because I need to convert pages on the fly and they have gifs with transparency in them.
I'm a big fan of FOP but my host doesn't do java and memory seems to be an issue for big files.
I can't use pdflib since the ROI is not worth it.
Anyone else been on this search before?
all help is welcome.





http://www.ros.co.nz/pdf/
is all you need !
Bookmarks