HTML to PDF
I would have thought that producing a PDF was not that hard. We take some industry standard markup*, thrown it into a library, and get a PDF out the far side. Right? Wrong!
*By industry standard markup, I of course mean HTML. What else ?
To start with there is not a lot of compatibility between HTML and PDF markup, and secondly thats just not how it works. Most libraries concentrate on building a document by positioning each item of text or graphic or line or curve individually. Which is fiddly.
I went through every library I could find yeasterday, so find one that can do a good job of HTML=>PDF (and by that I mean rendering HTMl, CSS images etc). And the winner...is of course the second most expensive one. I should have known that
- The most expensive one would not work (for my purposes)
- Anything cheap or free would not work for my purposes.
Therefore, the best was the second most expensive.
Drumroll...
I ruled out:
Spre Office: Html-pdf does image capture (i.e. the text is no longer live) and the the compression makes it of unsuitable quality
- PDFSharp: no Html-pdf but a nice looking library
- HTMLDOC : no css support
- ABCpdf : not good enough
And todays winner
www.evopdf.com/defalt.aspx which was, by all accounts nearly flawless. Some HTML5/CSS3 gradients and curves were less than perfecct, but to build an invoice or a datasheet it will do just fine.