Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate a business letter for 100+ leads using wkhtmltopdf

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.

like image 270
Sumit Gupta Avatar asked May 22 '12 16:05

Sumit Gupta


3 Answers

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

like image 187
Leo Kolezhuk Avatar answered Oct 23 '22 05:10

Leo Kolezhuk


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?

like image 44
marquito Avatar answered Oct 23 '22 05:10

marquito


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.

like image 45
Sumit Gupta Avatar answered Oct 23 '22 05:10

Sumit Gupta