5

We need to print Business Letter for a given list with mail merge facilities.

My client is not willing to spend $$ on a paid ASP.NET control to make PDF. So I opted in for WKHTMLtoPDF and it works fine for us until one day the client tried to get a PDF of 100+ leads, resulting in complete failure of PDF generation. It works just fine with a 10-20 page PDF, but not for 100.

Are there any tips & tricks to improve performance? We are using Cloud-hosted IIS 7 with ASP.NET 4 if that matters.

Bobrovsky
  • 13,789
  • 19
  • 80
  • 130
Sumit Gupta
  • 2,152
  • 4
  • 29
  • 46

4 Answers4

5

PDFSharp library is really a nice one!

I have used it for quite a while now, and I find it flexible enough to fulfill your needs.

However there are some aspects of using it as a "standalone library" - e.g creating tables is a headache and there aren't much text formatting options. It is much better to mix it together with MigraDoc (an extension library for PDFSharp).

Leo Kolezhuk
  • 346
  • 3
  • 7
  • Well, latest version of wkhtmltopdf is much improved and is best as it take a simple HTML and do the job. PDFSharp is good, but is complicated when compare to wkhtmltopdf. But thanks for your link it looks good. – Sumit Gupta Feb 26 '16 at 14:58
3

If you're looking for a really free (as in "free of worries") library, choose iTextPDF versions prior to version 4.1.7, as they state in the ByteScout blog.

From the ByteScout blog:

iTextSharp 4.1.6 DLL only: itextsharp-4.1.6-dll.zip
iTextSharp 4.1.6 Source Code (C#): itextsharp-4.1.6.zip

I'm not sure I understand your problem but couldn't you generate docx documents and get the same results?

Community
  • 1
  • 1
marquito
  • 885
  • 11
  • 29
3

For all, I use http://wkhtmltopdf.org/ to create HTML to PDF, my ASP.NET code generate the HtML file then I create HTML to PDF and it is done, much easier than using itextpdf's Table and td structure to get things in better space. I found it easy and fast once you get your stuff aligned properly.

library has improved since original question asked and it performs better now.

Sumit Gupta
  • 2,152
  • 4
  • 29
  • 46
2

here is good tutorial http://www.codeproject.com/Articles/20640/Creating-PDF-Documents-in-ASP-NET

Nurlan
  • 505
  • 1
  • 4
  • 11