Document() initialization throwing OutOfMemory exception while converting html string to pdf in Aspose.PDF in .Net

Hi Team,
We’ve procured Aspose total license. We’re trying to generate PDF from HTML template string but Aspose PDF library is throwing OutOfMemory exception while initialization iteself. We got a high priority blocking issue raised because if it.

We’re using Aspose pdf .net library version 24.2.0

We’re using Aspose.Pdf.Document(Stream inputHtml, LoadOptions options) method for converting html string to pdf.
We’re using below logic for Html to pdf conversion -

               	string htmlStr = “Sample html string”;
                HtmlLoadOptions options1 = new()
                {
                    // set Print or Screen mode
                    HtmlMediaType = HtmlMediaType.Print,
                    IsEmbedFonts = true,
                    //PageInfo = { Width = 794, Height = 1191, IsLandscape = true }
                    PageInfo = {
                        Width = Aspose.Pdf.PageSize.A4.Width,
                        Height = Aspose.Pdf.PageSize.A4.Height,
                         Margin = { Left = 10, Right = 10 }
                    }
                };

                byte[] byteArray = Encoding.UTF8.GetBytes(htmlStr);
                htmlStr = string.Empty;

                Aspose.Pdf.Document pdfDocument;
                using (MemoryStream htmlStrStream = new(byteArray))
                {
                    pdfDocument = new Aspose.Pdf.Document(htmlStrStream, options1);
                }
                byteArray = Array.Empty<byte>();
                pdfDocument.FreeMemory();
                pdfDocument.SetTitle(uwSummary.CedingCompany);
				
				AddHeaderToDocument(pdfDocument, headerText);
                AddPageNumberToDocument(pdfDocument);
                pdfDocument.FreeMemory();
				
				byte[]? pdfByteArr = null;
                using (MemoryStream ms = new())
                {
                    pdfDocument.Save(ms);
                    pdfDocument.Dispose(); //Disposing Aspose PDF object instance to free memory

                    pdfByteArr = ms.ToArray();
                }
				
				return pdfByteArr;

**We have already handled memory leak issues as much as possible but still the library method is not able to match our requirements. We have already raised couple of support tickets related to library slowness issues but they are not addressed yet. We have already reported performance related issues with same library which is still not addressed. Now we have got a blocker issue. This is causing negative impact on our client business. **

Please find the attached HTML file which is causing this issue
Team can you please help us to get it fixed as soon as possible. Please provide an ETA as earliest.
Aspose_pdf_conversion_issue_html_sample.zip (1.7 MB)

@tusharsahu

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-56670

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.