Reputation: 1412
I am using SelectPDF to generate pdfs from a cshtml template. My PDF generates locally, but when on production I get an error.
Stack trace: at SelectPdf.HtmlToImage.?(String A_0, String A_1, String A_2, ?[]& A_3, ?& A_4)\r\n at SelectPdf.HtmlToPdf.?(String A_0, String A_1, String A_2, String A_3, Boolean A_4)\r\n at SelectPdf.HtmlToPdf.ConvertHtmlString(String htmlString)\r\n at Test.GenerateSelectPDF(ReportObj report)\r\n at Test.ReportsController.d__6.MoveNext()
I've ensured that the dll, Select.Pdf.dll and Select.Html.dep are in my bin folder along with Select.Pdf.xml and Select.Tools.dep.
Since I can generate the same report locally I think this is a configuration issue.
Upvotes: 3
Views: 2393
Reputation: 61
I've experienced a similar issue: System.Exception: Conversion failure error 5.
Regarding the documentation - Select.Html.dep missed execute permissions. I've added execute permissions for IIS AppPool\DefaultAppPool (change user if your app is not running under default pool) and that resolved the problem.
Upvotes: 0
Reputation: 21
Check the execution by increasing the MaxPageLoadTime property of the converter (HTMLToPDF object)
By default, the value is 60 seconds
Example:
converter.Options.MaxPageLoadTime = 240;
Reference: Link
Upvotes: 1