News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Convert HTML to PDF with Dompdf
August 15, 2013 @ 10:39:16

On PHPMaster.com there's a new tutorial from Shameer C showing you how to use Dompdf to convert HTML to PDFs. The handy library makes it (relatively) simple to automatically generate the documents without the need to know the internal PDF file structure.

PDF is a standard format originally created by Adobe for representing text and images in a fixed-layout document. It's not uncommon for a web application to support downloading data, such as invoices or reports, in PDF format, so in this article we'll go through how we can easily generate PDF documents using PHP.

He starts off with the installation (via Composer) and the creation of a simple "Hello World" document, showing how to "stream" it into a PDF file. He also includes some more advanced usage - loading an external HTML, drawing lines, changing fonts, adding page numbers and additional text to the page.

0 comments voice your opinion now!
html pdf convert tutorial dompdf adobe

Link: http://phpmaster.com/convert-html-to-pdf-with-dompdf

Raymond Kolbe's Blog:
DOMPDF in ZF2
July 06, 2012 @ 10:08:27

Raymond Kolbe has a recent post to his blog about using the DOMPDF library to generate PDFs in a Zend Framework 2 application.

If you're using Zend Framework 2 (beta 4) and need to easily generate PDFs, and you'd like to generate those PDFs from an HTML template, then boy do I have some good news for you! For those of you who have dealt with generating dynamic PDFs, you know how much of a pain in the ass it can be (e.g. dealing with x, y coordinates, word-wrap (or lack of), etc.). There are a few options out there, some paid, some free, but none of them are as nice as DOMPDF (simple API, powerful, and free). The true power behind DOMPDF comes from rendering standard HTML/CSS files instead of having to write ugly and unmanageable code.

He includes a simple example showing how to use the library to create a basic PDF document (containing an HTML string) and how to port that same thing over to work in ZF2 via a custom DOMPDFModule (a ViewModel). You can find out more about this module in it's README on github.

0 comments voice your opinion now!
dompdf zendframework2 tutorial viewmodel



Community Events





Don't see your event here?
Let us know!


community tool version language security package symfony update composer mvc voicesoftheelephpant series framework interview introduction laravel opinion library podcast release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework