We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Pdf.Document Error when converting html to pdf

My organization is using version 12, I don’t believe our license permits using a later version and we are not able to renew at license at this time to get the latest version.

The following error appears on the longer html strings: max (300000) < opt (665060) the number on the right changes. Not exactly sure why the error is appearing, my assumption is due to length of the html. The following works up to a certain length in the html string, are there limitations on length using the recommended method below?

var htmlLoadOptions = new Aspose.Pdf.HtmlLoadOptions();
htmlLoadOptions.PageInfo.IsLandscape = true;
htmlLoadOptions.InputEncoding = “UTF8”;
var htmlMemoryStream = new MemoryStream(Encoding.UTF8.GetBytes(htmlString));
var pdfDocument = new Aspose.Pdf.Document(htmlMemoryStream, htmlLoadOptions);

htmString length = 906731
htmlMemoryStream length 906757

Thanks in advance for any insight.
Scott

@skadoo

Please note that the support is available based on latest version of the API and we always recommend using latest version because it includes more features and bug fixes. Kindly try using Aspose.PDF for .NET 19.2 and then share your kind feedback with us.

Moreover, you may request for a free 30-days temporary license to test the API in its full capacity. For any purchase related information, you may create a post in Purchase Forum.

I understand support is based on the latest version. Is my understanding of the error message meaning the file length is to long correct?

@skadoo

We are afraid we may not verify or confirm it without reproducing it in our environment. We can specify this if the issue persists with latest version of the API.