views:

1133

answers:

6

Hello

I am looking for a C/C++ library to convert HTML (Actually XHTML + CSS) documents to PDF.

It is for commercial use and source would be nice but not essential.

Anybody have any recommendations or experience doing this?

UPDATE: To clarify, I am targeting the Windows platform only. I am developing with Borland C++ Builder 2006, but the library does not have to be a VCL component.

Many thanks in advance.

Steve.

A: 

Wouuld CLI applications do? If memory fails me not, GNU Ghostscript had utilities html2ps and ps2pdf. Source should be available too.

Vilx-
Sorry, CLI wont do, thanks for suggestion though.
QAZ
A: 

CutePDF is a free PDF writer that works as a virtual printer. I guess you could use this in conjunction with anything that could render your HTML.

Shane MacLaughlin
A: 

This is probably overkill, but WebKit for rendering, with Cairo for the backend could do it. WebKit is a pretty big library, though.

If you are looking for something pre-made, I found wkhtmltopdf after some quick searching. It uses WebKit and Qt for rendering, which is and even larger combination of libraries.

Jeff M
A: 

Have a look at PrinceXML.

It's definately the best HTML/CSS to PDF converter out there, although it's not free (But hey, your programming is not free either, so if it saves you 10 hours of work, you're home free.)

Oh yeah, did i mention that this is the first (and probably only) HTML2PDF solution that does full ACID2!?!?!

http://princexml.com/samples/

SchizoDuckie
A: 

Just to bump this, I have evaluated both VisPDF and PDFDoc Scout and will probably go with PDFDoc Scout as it can format HTML input.

Thanks for everybody else's input.

QAZ
A: 

I tried HotPDF library, it is easy to use and good enough.

Sergio