SelectPdf Error: Could not get conversion result header. Data receive timeout. [SelectPdf Library for .NET C#]

207 Views Asked by At

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.

1

There are 1 best solutions below

0
Denis Kiryanov On

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.