PHP Create PDF
file on fly With FPDF
This tutorial demos how to create a PDF file on fly with
FPDF.
The PDF ( portable document format) file is an versatile
format for transferring a document over the Internet.
Many companies use the PDF format to transfer contracts, manuals,
and other documents over the Internet without trying to convert them
to HTML or changing the format of the document in any way.
This code will be useful
if you were considering creating invoices, reports or any other
hardcopy file for your client.
FPDF introduction
FPDF is a PHP class which allows to generate PDF files with pure
PHP, that is to say without using the PDFlib library. The advantage
is that PDFlib requires a fee for
a commercial usage. F from FPDF stands for Free: you may use it for
any kind of usage and modify it to suit your needs.
FPDF has other advantages: high level functions. Here is a list
of its main 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 requires no extension (except zlib to activate compression)
and works with PHP4 and PHP5.
In order to create a PDF file, all you need is fpdf.php file, which
is downloadable at http://www.fpdf.org.
Create PDF Examples by using FPDF
|