Our Environment Details.
• Microsoft .Net Core 2.1 with C#
• React Js and Redux
• Spire Office 5.9.2 with suggested plugin
Because of .net core, we are using the standard HTML Converter link with plugins, to generate the pdf.
As per the business need, we are displaying a gird of records in the PDF and the solution works fine till 200 records but as soon as we try to generate a pdf with 300 records, it doesn’t work. Even it does not throw any exception back.
Here is the code we are using to generate a PDF where “viewHtml” is the input html for PDF and “outputFile” is the name with path
- Code: Select all
Spire.Pdf.HtmlConverter.Qt.HtmlConverter.Convert(viewHtml,
//File name with path
outputFile,
//enable javascript
true,
//load timeout
100 * 6000,
//page size
PdfPageSize.Letter,
//page margins
new Spire.Pdf.Graphics.PdfMargins(15, 15, 15, 78),
//load from content type
LoadHtmlType.SourceCode);
The above code works fine until 200 records in the grid but it fails when we pass an html having 300 records.
I have attached following file for a quick review.
1. ViewHtml_100.html and ViewPDF_100.pdf
2. ViewHtml_200.html and ViewPDF_200.pdf
3. ViewHtml_300.html – NO PDF GENERATED and NO EXCEPTION TOO.
Our observation:
There is a load time out parameter in the convert function but it doesn’t seem to be working as expected. For our solution we tried to set it from 30 seconds to 10 minutes but the call never waited more than a minute.