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

[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.
#2

[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.
#3

[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
    $this->Image('logo_pb.png',10,8,33);
    //Arial bold 15
    $this->SetFont('Arial','B',15);
    //Move to the right
    $this->Cell(80);
    //Title
    $this->Cell(30,10,'Title',1,0,'C');
    //Line break
    $this->Ln(20);

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

[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.
#5

[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