Skip to main content

Posts

Showing posts from March, 2013

dompdf : New Font Installation

Steps to follow : 1)      Install DOMPDF 0.6.0 or greater (Recommended : 0.6.0_beta3 ) 2)      Enable the MBString PHP extension. 3)      Load a font supporting your characters into DOMPDF. 4)      Configure DOMPDF for Unicode support. 5)      Create a compatible HTML document. First two steps has already been covered in previous post. Check here : dompdf : HTML to PDF Converter in PHP 3) We are going to u se web-based font prep tool to install font. This option is provided for users who are unable to set up the ttf2ufm application. This tool produces an archive containing the necessary font metrics file(s), the original font file(s), and a sample dompdf_font_family_cache that you should be able to use with your DOMPDF installation. AfterSimply provide a font name and the TTF file(s) (at a minimum you must provide a font file for the base variant); select the font parser (the PHP-based parser is recommended for larger fonts); and choose the version of DOM

dompdf : HTML to PDF Converter in PHP

Recently, there was an requirement in a project to convert HTML to PDF at run time. While I was going through google, found two very good libraries named 'wkhtmltopdf' and 'dompdf'. dompdf was fulfilling my criteria so i went with that only. Just sharing that with you. dompdf is an HTML to PDF converter library. At its heart, dompdf is (mostly) CSS2.1 compliant HTML layout and rendering engine written in PHP. It is a style-driven renderer: it will download and read external stylesheets, inline style tags, and the style attributes of individual HTML elements. It also supports most presentational HTML attributes. Download dompdf library from here . Recommended Version : 0.6.0_beta3 Requirements :  1)        PHP 5.0+ (5.3 recommended) 2)       MBString extension - for better Unicode support. 3)       DOM extension  (bundled with PHP 5) –“ The DOM extension allows you to operate on XML documents through the DOM API with PHP 5. ”  Pros:  1)       Easy to