Welcome Guest, Not a member yet? Register   Sign In
PDF Generation from X[HT]ML

I'm working on a relatively complicated project that is required to create PDF outputs, I'm currently using HTML2PDF to convert an XHTML file into a PDF. HTML2PDF is supposed to support the creation of multipage documents from a single file by using CSS properties such as page-break-after and page-break-inside. Unfortunately it will only generate the first page properly, the second page will be cropped missing an entire inch. This unfortunately means that I have to generate a PDF for every single page and then splice these together.

The other downside is that a modest 24 page document takes about 180MB of RAM to generate, eats up most of a core and takes about three minutes. What I'm looking for is a free or moderately priced PDF generation solution that can push files out properly and hopefully not start bringing down servers when ten users decide to do it at once.

Anybody have any suggestions? It doesn't have to be PHP, as long as I can interact with it via a wrapper or through the command line.

Yes, HTML2PDF uses PDFlib or FPDF, the problem is that it interprets the XHTML improperly, at least I believe that's the problem.

Because it's a more or less fast method to create an XHTML file (These are very graphically complex) then deal with stuff like...

    //Arial bold 15
    //Move to the right
    //Line break

And it more or less wasn't my choice, but don't tell anybody that Wink

Have a look at dompdf (search forum for info). It does what you have problems with and generates PDFs from your html views. It does two passes and you can script graphical elements on the second pass.

[eluser]Michael Wales[/eluser]
BambooInvoice is a great example of PDF generation (through a view) in a live application.

Theme © iAndrew 2016 - Forum software by © MyBB