Recent Posts

Showing posts with label PDF. Show all posts
Showing posts with label PDF. Show all posts

Convert a HTML and CSS document to PDF with PHP

To convert an HTML document with CSS stylesheets you have to take a look at PrinceXML.

It's definitely the best HTML/CSS to PDF converter out there, although it's not free (But hey, your programming is not free either, so if it saves you 10 hours of work, you're home free.)

Oh yeah, did I mention that this is the first (and probably only) HTML2PDF solution that does full ACID2!?

PrinceXML Samples

Read a PDF file with PHP

For this there's a PHP library called FPDF (with FPDI):

http://www.fpdf.org

http://www.setasign.de/products/pdf-php-solutions/fpdi/

These will let you open an pdf and add content to it in PHP. I'm guessing you can also use their functionality to search through the existing content for the values you need.

Another possible library is TCPDF: http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf