Many web applications output documents like invoices, contracts or just web pages in the PDF format. There are a few PHP classes which can be used for creating PDF files online, one of create pdf using jquery is TCPDF.
This tutorial is about how-to use the TCPDF class while creating a simple invoice document. A function that creates invoices online, is very common for a website that sells goods or services. Why TCPDF and not some other PHP class?
TCPDF is based on the FPDF class, a very stable project written originally for PHP4. Since several years has TCPDF much more features than FPDF and is written for PHP5. AI vectorial images and many more.
It’s a required function which was suggested as the Zend_Pdf_Cell 2 years ago and didn’t find the way to the core version until now. I like the Zend Framework a lot but not for creating PDF documents, the PDF class is much too limited. In this tutorial we create a PDF invoice including header logo, the invoice rows, an information box and some footer row.
All coordinates are measured in Millimeters and the height for the image is calculated by the script. TCPDF functions which makes it easier to place some text box into the PDF document.