9

Is there any open source .NET project (or port) similar to the Flying Saucer project which renders HTML to PDF using iText?

Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
Tawani
  • 11,067
  • 20
  • 82
  • 106

4 Answers4

3

I always recommend wkHTMLtoPDF for web->PDF conversions. It's web kit based though I'm not sure what PDF library it's sitting on.

At any rate, you'll be hard pressed to find something that will render your HTML more accurately (it'll even run script, set innerHtml and so forth).

Mark Storer
  • 15,672
  • 3
  • 42
  • 80
  • I could not find an appropriate .NET download on the wkHTMLtoPDF website so I searched the NuGet library and found **Codaxy.WkHtmlToPdf**. Also available on [github](https://github.com/codaxy/wkhtmltopdf). It would be nice to have a quick example/tutorial to get started with. – fireydude Jun 30 '13 at 22:29
  • Codaxy.WkHtmlToPdf depends on having the WkHtmlToPdf executable installed on the server which is no use to me so I am using [Pechkin](https://github.com/gmanny/Pechkin) instead. The NuGet package had a problem with the Common.Logging dependency to had to download it from github. – fireydude Jun 30 '13 at 23:29
1

Use the Pechkin .NET wrapper for WkHtmlToPdf. The resulting pdf can be outputted as a byte[], filestream or file path.

The NuGet package had a problem so I downloaded it directly from github and it seems to be working now.

fireydude
  • 1,181
  • 10
  • 23
1

For a quick-and-dirty solution you could try using IKVM to compile the Java to .NET.

http://www.ikvm.net/

Axl
  • 8,272
  • 2
  • 26
  • 18
0

wkHTMLtoPDF is based on WebKit so shares limitations - most importantly for common requirements in converting HTML to PDF as of this date WebKit cannot repeat table headers and footers across pages sans hacks and it does not look like this is going to change any time soon.

Fentex
  • 1