Skip to main content

PDF generation in PHP

There are several ways to generate PDF files using PHP

OPTION #1

One of the most adorable features of PHP 4 is the PDFLib extension, which allows you to dynamically construct PDF documents in Adobe Portable Document Format. For this you must have the PDFLib library installed on your system. If you're working on Linux, you can download a copy from http://www.pdflib.com/ and compile it for your box.

If you're running Windows,a pre-built PDF library is bundled with your distribution, and all you need to do is activate it by uncommenting the appropriate lines in your PHP configuration file.

In addition to this a PDF viewer application like Adobe PDf reader must be installed in your machiine to view the PDF file.

More on PHPLib Extension



OPTION #2
Another option is to use the PDF genertion Class files available as opensources.

Example:

1. FPDF
2. TCPDF
3. MPDF




FPDF CLASS

FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. 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, PNG and GIF)
* Colors
* Links
* TrueType, Type1 and encoding support
* Page compression

Some disadvantages is fpdf is less flexible in handling styles and HTMLs.
Website : FPDF CLASS



|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||



TCPDF CLASS

TCPDF is an Open Source PHP class for generating PDF documents.
TCPDF project was started in 2002 and now it is freely used all over the world by millions of people. TCPDF is a Free Libre Open Source Software (FLOSS).

An Advanced version of FPDF. FPDF class is modified to make it more flexible to handle in TCPDF.
This class has some limitations in handling some of the style and style sheet inclusions, but still user friendly class.

Main Features:

* no external libraries are required for the basic functions;
* all ISO page formats, custom page formats, custom margins and units of measure;
* UTF-8 Unicode and Right-To-Left languages;
* TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;
* methods to publish some XHTML + CSS code, Javascript and Forms;
* images, graphic (geometric figures) and transformation methods;
* native support for JPEG, PNG and SVG images;
* 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, QR-Code;
* Grayscale, RGB, CMYK, Spot Colors and Transparencies;
* automatic page header and footer management;
* document encryption and digital signature certifications;
* transactions to UNDO commands;
* PDF annotations, including links, text and file attachments;
* text rendering modes (fill, stroke and clipping);
* multiple columns mode;
* bookmarks and table of content;
* text hyphenation;
* automatic page break, line break and text alignments including justification;
* automatic page numbering and page groups;
* move and delete pages;
* page compression.

Website : TCPDF CLASS



|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||



MPDF CLASS

This can be considered as on of the best classes for PDF generation. mPDF is a PHP class which generates PDF files from UTF-8 encoded HTML. It is based on FPDF, HTML2FPDF, and UFPDF, with a number of enhancements.

Click Here for Features

Website : MPDF CLASS

Comments

Popular posts from this blog

Deep-sea Anglerfish Black Seadevil Scary looking creature Video

Deep-sea Anglerfish are the strange and elusive creature that are very rarely observed in their natural habitat. Fewer than half a dozen have ever been captured on film or video by deep-diving research vehicles.They are mostly  found in tropical to temperate waters of the Indian,Pacific and Atlantic Oceans.

How to use WiFi adapter on Ubuntu 16.04 desktop PC - Realtek RTL8188EUS 802.11n Wireless USB Network Adapter Driver installation

Installation of Realtek RTL8188EUS 802.11n Wireless USB Network Adapter on Desktop PC having Ubuntu 16.04 OS My PC is running in Ubuntu 16.04 OS, recently I thought of using a dongle wife adapter to access our home's Wifi network. For this I used Realtek RTL8188EUS 802.11n Wireless USB Network Adapter ( Model No: OT-WUA950NM ) This small device cost around Rupees 250/- to Rs 300/- in India. I did the following steps for installation of this Realtek Nano Wifi Adapter: Plug Realtek RTL8188EUS 802.11n Wireless USB Network Adapter to your PC's USB port, Take the terminal application and run the command "lsusb" to list the plugged in usb devices: Myhome:~$ lsusb Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 003: ID 0bda:8179 Realtek Semiconductor Corp. R...

Cheap Tourist boat service in Alapuzha - Enjoy the beauty of Aleppey Back waters using govt owned Tourist boat services

Feasible Tourist boat services in Alapuzha Aleppey / Alappuzha is one of the beautiful places in kerala. Aleppey district is famous for it amazing backwaters , you can enjoy house boat rides here. Kerala State Water transport department  (Kerala SWTD) provides facilities for tourists to enjoy the beauty of backwater by paying much less charge when compared to private boat services. There are boat services from Aleppey boat station which takes tourists to inner parts of the backwaters.


Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to recruit.vo@gmail.com   Read more »
Member
Search This Blog