Convert HTML String to PDF using C#

“Index was outside the bounds of the array.”

I am trying to convert a large HTML string to PDF.
On a smaller bit of HTML, it works no problem but there is something causing error on this call:

Document doc = new Document(new MemoryStream(Encoding.UTF8.GetBytes(html)), objLoadOptions);

I can provide the HTML that is causing this issue if required.

@angelbert.david

Please share your sample HTML string in a .txt file. You can add the .txt file to .zip archive and upload with your reply. We will test the scenario in our environment and address it accordingly.

test.zip (399.0 KB)
Hi Asad. Attached is the zip file. Thank you

@angelbert.david

We were able to replicate the issue in our environment while converting HTML String to PDF using C# and Aspose.PDF for .NET 22.2. Therefore, an issue as PDFNET-51376 has been logged in our issue tracking system for the sake of correction. We will look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi Asad.

I was wondering if you had any progress on this issue?

thank you.

@angelbert.david

The ticket has recently been logged in our issue management system and it is pending for analysis. We will surely investigate and resolve it on a first come first serve basis and let you know as soon as it is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-51376) have been fixed in Aspose.PDF for .NET 22.6.