In my previous post I have discussed creating a PDF file form HTML code using PHP on the fly through domPDF library. These kind of requirements generally come up when you creating accounting softwares and are required to send an online invoice, quote or any other confidential document to customer or any user through email.
Creating a PDF form HTML has always been a pain for PHP developers. Yes, there are some web services available on the internet who can do this job pretty well. But what happens if the web service is down? Your daily work can stuck up and can cause loss in business and time.
PHP Developers now listen Loud and Clear.
Here we are with yet another flawless script to create PDF form HTML “mPDF“. This set of php library overcomes all the set backs of domPDF like nested tables were not allowed (still in early stage of development), strict HTML, any carelessness in writing code will lead you in lot of errors. This causes heavy loss of development time.
mPDF makes all the tasks easy. Its an intelligent script to create PDF form HTML using PHP on the fly.
Exclusive Features of mPDF-
mPDF is a PHP class which generates PDF files from UTF-8 encoded HTML- by Ian N Back
- UTF-8 encoded HTML
- Almost all languages including RTL (arabic and hebrew), and CJK – (chinese-japanese-korean)
- CSS stylesheets
- Word spacing and character spacing for justification
- Nested block-level elements (e.g. P, DIV) including margins, borders, padding, line-height, background colours etc.
- Page layout and orientation
- Page numbering
- Odd and even paging with mirrored margins
- Page headers & footers
- Tables – nested tables, rotated, or autosized to fit on a page
- Text-justification and hyphenation
- Table of contents
- Images as JPG GIF PNG WMF
- Password protection.
What Else You Want????
Remember to get the Sample demo file I have created for you to get you started after set up of mPDF on your system.
Instructions- Place the above sample file in the root folder of your application where mpdf folder is located. The structure should be like below:
- MyWebsite (your own Folder main application)
+ mPDF (Folder all the files)
- Sample PHP file above
More information on the usage can be found in the below official documentaiton.