3

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.

6
  • The version of SelectPDF is v17.3.0, using .net 4 assemblies Commented Feb 27, 2018 at 19:47
  • I have changed my template files to generate a single div with the word 'test', so I am now sure that the html being generated is not the problem. Commented Feb 27, 2018 at 20:32
  • did you ever find a solution to this? I'm getting a very similar error, but it's intermittent and driving me insane. Thanks! Commented May 21, 2018 at 17:11
  • I'm getting this exact problem as well, did you ever find a solution? Commented Apr 2, 2020 at 13:24
  • 1
    I never did find a solution and started using wkhtmltopdf instead. Commented Jun 25, 2020 at 11:34

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.