6

I am in search of a FREE HTML to PDF converter for .NET which preferably takes an HTML page and renders it into a PDF document.

The HTML page (when printed) will most often be more than one page. I know of ABCPDF, but from a quick overview, it appears it just wants to convert a single page of HTML and doesn't handle multiple pages well. I could be ignorant of its capabilities as I haven't put very much research into ABCPDF yet. The only other one I have gently used is iText, but that seems like it may become very complicated for the application I need.

Please let me know if you have any recommendations. If you know of one that does cost per license, but does exactly what I need, let me know.

Thanks!

BueKoW
  • 926
  • 5
  • 18
  • 33

7 Answers7

8

EDIT: ABCPDF no longer offers a free option unless you can satisfy their requirements of either being a Worthy Cause or a Worthy Individual. More details here: http://www.websupergoo.com/free-license.htm

ABCPDF will handle multiple pages, as stated in this link - "You can even have HTML flowed between multiple columns over multiple PDF pages."

I've used it extensively and found it to be pretty good.

Either that or iTextSharp if you're after open source options.

If you've got some money to spend, then have a look at Aspose.PDF.

Town
  • 14,706
  • 3
  • 48
  • 72
  • 1
    Please note that iText/iTextSharp are free for open source projects only. There is [probably expensive] commercial license for other cases, though. – Bobrovsky Apr 01 '11 at 15:34
  • I am using ABCpdf for multiple pages too, and it works well. – Urbycoz Apr 05 '11 at 09:38
  • @Bobrovsky: Good point, I've updated my answer. – Town Apr 05 '11 at 09:47
  • Paged HTML Example can be found here: http://www.websupergoo.com/helppdf8net/source/4-examples/13-pagedhtml.htm – AffineMesh May 27 '11 at 03:40
  • Just a note for others: ABCPDF isn't free - but there is a (laborious?) promotional programme to get a free license. – PeterX May 17 '13 at 00:07
  • Why suggest ABCPDF when it is clearly not free? Please see: http://www.websupergoo.com/free-license.htm – VBobCat Oct 26 '16 at 13:01
  • @VBobCat You may have missed the date on the answer... it's from over 5 years ago. It's a while ago now, but IIRC WebSuperGoo used to offer a free option if you provided credit for their library on your page. – Town Oct 26 '16 at 15:06
8

Just implemented something similar in one of my projects using wkhtmltopdf (webkit based) I'm rendering views or partial views to strings, writing them to temp html file and sending starting the exe in a new System.Diagnostics process..

The pdf's look absolutely awesome, it works with external css sheets and everything.

Michiel Cornille
  • 2,067
  • 1
  • 19
  • 42
3

I don't know of a free one, but we use Aspose.PDF for .Net to generate PDFs from files hosted in SharePoint through a custom document converter. HTML is one of the supported formats.

Note: I have no affiliation with Aspose, I've just been pleased with the component they provide.

vinny
  • 1,810
  • 15
  • 21
2

ITextSharp can do this for you. http://itextsharp.com/

This answer has some links to some code.. Convert HTML file to PDF file using ITextSharp

Community
  • 1
  • 1
Aim Kai
  • 2,934
  • 1
  • 22
  • 34
1

You can give a try to: https://github.com/pruiz/WkHtmlToXSharp

Pablo Ruiz García
  • 573
  • 1
  • 5
  • 9
1

Winnovative HTML to PDF converter is what I've used for years. Great tool, good documentation.

http://www.winnovative-software.com/

HasanG
  • 12,734
  • 29
  • 100
  • 154
Curtis
  • 101,612
  • 66
  • 270
  • 352
1

This isn't an exact fit, but this should work for you with a little modification if you have MS Word installed on the machine executing the code. All you should have to do is open the HTML as a Word document (since MS Word can open HTML). It's a free way to do it if it works for you.

BrandonZeider
  • 8,014
  • 2
  • 23
  • 20
  • Thank you - this would be simple, but I am trying to go without having to install Word on the server. – BueKoW Apr 01 '11 at 13:27
  • No problem - when I was looking, I didn't think there was a library out there that didn't require an installation, and since we had licenses for MS Word already, we opted to just install MS Word. Good luck! – BrandonZeider Apr 01 '11 at 13:46
  • It fulfills my needs and is surprisingly quick even though I'm generating a dozen PDFs at a time. Thanks @BrandonZeider! – GeoffM Aug 22 '13 at 23:28