Commercial solution to convert HTML to PDF

Posted on 2007-09-28
Last Modified: 2008-02-07

We are looking for any product that can take an exceedingly simple PHP-generated web page (text/lists/tables/graphics) and generate a PDF of that page on the server. The product must have the following:

- Work in a LAMP environemt
- Ability to generate custom top/bottom/left/right margins in the PDF file
- Handle graphics and tables, minor CSS styles (font specifications)
- Be somewhat easy to install and use or have pretty good support and documentation
- Be called from another PHP script and be able to open a page with a query string

The idea is that a user will submit some HTML as generated by an fckeditor textarea to a MySQL table.  A script will then put various elements from the table together as HTML and we then need that result to be saved on the server as a PDF.

We have looked at htmlDOC already, but I was not overly impressed with the demo at pdf-o-matic and really not impressed with the documentation.

Any other suggestions are appreciated.  Free is best, but I have secured a budget for this project and am willing to pay for a solution that meets all of the above requirements.
Question by:Jason C. Levine
    LVL 48

    Accepted Solution

    Have you looked at

    Else htmlDOC is the most common used tool on linux to convert html to pdf if you have big html pages. We produce our manuals with htmlfoc from the onlinehelp. But maybe someone else has another tool. Guess for windows the list of available programs is bigger.
    LVL 11

    Assisted Solution

    by:Jeff Darling
    I've never tried htmlDOC, but upon seeing this question I looked into a PHP Pear solution that seems to work pretty nicely.  

    Here is a sample
    LVL 70

    Author Comment

    by:Jason C. Levine
    Hi hernst42,

    We have just started looking at dompdf...we were unaware of it until just recently.  It looks promising...

    Hi jeffld,

    That link looks to be a variation on fpdf.  Unfortunately, that won't work because I'd have to spend too much time converting the HTML output from the fckeditor textarea to syntax that fpdf would find acceptable.

    LVL 70

    Author Comment

    by:Jason C. Levine
    Thanks guys.  

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to dynamically set the form action using jQuery.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now