Generate PDF - how to create paged HTML content beforehand?

Posted by Alt_Doru on Stack Overflow See other posts from Stack Overflow or by Alt_Doru
Published on 2009-07-07T06:30:25Z Indexed on 2010/04/20 7:33 UTC
Read the original article Hit count: 363

Filed under:

My task is to create ready-to-print invoices from a .NET web app.

I am already generating the printer-friendly HTML for an invoice - it consists of an invoice header (that will actually need to appear on each printed page) and invoice positions (that may span multiple printed pages).

Now, my task is to generate a PDF server-side, populate a header on each of its pages, then populate its pages with invoice positions. I need to generate the PDF from the existing HTML data - by simply passing HTML input to the PDF generator library.

I've started using ABCPDF - I am using the AddImageHtml method. The problem I have is that ABCPDF seems to expect me to supply HTML content already paged. So, it won't work correctly when I feed it HTML content that would span on more than 1 PDF page.

So, my question is - do you have any suggestions on making this work with ABCPDF? Or, more generally speaking, what other tools/approaches would you use for this - generating PDF doc with headers/footers from HTML input?

Thanks

© Stack Overflow or respective owner

Related posts about pdf-generation