Generate a business letter for 100+ leads using wkhtmltopdf

48,973

Solution 1

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).

Solution 2

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.

Solution 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?

Share:
48,973
Sumit Gupta
Author by

Sumit Gupta

A Software developer!

Updated on March 24, 2021

Comments

  • Sumit Gupta
    Sumit Gupta about 3 years

    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.