0

Exception Message: Could not get conversion result header. Data receive timeout.

C# Code:

        public static MemoryStream ConvertHtmlToPdf(string html)
        {
            HtmlToPdf converter = new HtmlToPdf();
            PdfDocument doc = converter.ConvertHtmlString(html);
            var ms = new MemoryStream();
            doc.Save(ms);
            return ms;
        }

Exception is happenning at line PdfDocument doc = converter.ConvertHtmlString(html);

I am working in .NET Core 3.1, using package "Select.Pdf.NetCore" Version="22.2.0".

I encountered this error with a very large HTML string( 178 pages if you do Save As PDF in Chrome browser). Unfortunately, I am unable to share the HTML due to data privacy concerns. However, I want to clarify that the HTML is valid and can be successfully rendered in a web browser.

Hks
  • 1
  • 3
  • you'd better to have more code snippets here so that we could reproduce the issue. a mininal reproducable sample is helpful to troubleshoot the issue. – Tiny Wang Aug 07 '23 at 02:52
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 07 '23 at 06:21

1 Answers1

0

It's hard to say what has caused the problem. Does your HTML file contain Smart Forms, any VB scripts? This may be causing the problem.

Denis Kiryanov
  • 451
  • 3
  • 9