PDF Generation from X[HT]ML - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: PDF Generation from X[HT]ML (/showthread.php?tid=10073) |
PDF Generation from X[HT]ML - El Forum - 07-17-2008 [eluser]Aea[/eluser] 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. PDF Generation from X[HT]ML - El Forum - 07-18-2008 [eluser]Aea[/eluser] Yes, HTML2PDF uses PDFlib or FPDF, the problem is that it interprets the XHTML improperly, at least I believe that's the problem. PDF Generation from X[HT]ML - El Forum - 07-18-2008 [eluser]Aea[/eluser] Because it's a more or less fast method to create an XHTML file (These are very graphically complex) then deal with stuff like... Code: //Logo And it more or less wasn't my choice, but don't tell anybody that PDF Generation from X[HT]ML - El Forum - 07-18-2008 [eluser]Crimp[/eluser] 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. PDF Generation from X[HT]ML - El Forum - 07-18-2008 [eluser]Michael Wales[/eluser] BambooInvoice is a great example of PDF generation (through a view) in a live application. |