FPDF – Create PDF files with PHP
First of all, this post is tailored to PHP developers out there or at least to anyone who’s interested to create an engine or a web application that can create PDF files.
If you are working in an I.T company that produces billing statements or even web reports, then you’d probably be asked to create PDF documents. That’s where you need a PDF creation engine, such as FPDF. It’s free (for both personal and commercial use)
Now, honestly, I haven’t tried FPDF yet. I knew this from a good friend of mine this morning. He needs to create billing statements for the company’s clients.
FPDF features:
- Choice of measure unit, page format and margins
- Page header and footer management
- Automatic page break
- Automatic line break and text justification
- Image support (JPEG and PNG)
- Colors
- Links
- TrueType, Type1 and encoding support
- Page compression
FPDF works for both PHP4 and PHP5 and doesn’t require you to install anything else (according to the author).
If you have used FPDF, please feel free to share your experience with us here on the comments section. To know more and download FPDF, go to their site here.
There is also a JAVA alternative, called iText. I’ve heard of iText a couple of years ago and it was still under heavy development at that time. I’m not sure how it is now, but if you want to give it a try, iText project site is located here.
|
To get the latest posts on this blog, subscribe via your favorite RSS feed reader (What is RSS?) or by entering your email address on the form below: |




FPDF is one of the better PDF-generating PHP libraries out there. I know, because I’ve gone through a few
can it convert dynamically generated data to php? Ive been trying to convert a php page to pdf but it only converts the html part. Not the generated data from db. I need help on this. Thanks.
i am working with php and the company required me to produce reports. i have read an article about fpdf, please help. is it really working?
Sorry I’m not sure, as I myself haven’t used FPDF before. I hope you can find better information out there!
Yep, it definitely works — I’ve used it for a number of web apps. It’s one of the more mature PDF libraries for PHP. Otherwise you could try the Zend Framework PDF module.
I’m having some problems with the FPDF class. I’m hoping you can help me. I’m using FPDF to write some text on a PDF. I’m displaying 8 different cells of text. The Cells are being displayed, but after two cells, it puts the next cell onto a new page as If I had asked for a new PDF page to be made, but I did not. I’m guessing it is somehow pushing them down and pushing it onto the next page. How can I get rid of these annoying spaces and make it all fit on only the one PDF page?
I posted my complete issue with the code here: http://stackoverflow.com/questions/1496888/why-are-there-unexpected-spaces-on-my-pdf-using-fpdf-with-php
You can view the outputted pdf here: http://idea-palette.com/pdf/
Hm sorry I can’t help you Chris as I haven’t actually tried the FPDF class myself. We are using a Perl engine called PDFEverywhere in the office, so I haven’t had a chance to try this out
Sorry I don’t use FPDF so unfortunately I can’t help you out on this one…