Memory Leak - Floating Box off Page with text

I'm encountering a memory leak when a floating box is off the page with some text.


Dim file As New MemoryStream

Dim myReport As New Aspose.Pdf.Document

Dim myPage As Aspose.Pdf.Page = myReport.Pages.Add()


Dim floater As New Aspose.Pdf.FloatingBox

floater.Width = 50
floater.Height = 20

floater.Top = 4000
floater.Left = 50

floater.BackgroundColor = Aspose.Pdf.Color.Green

floater.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center
floater.VerticalAlignment = Aspose.Pdf.VerticalAlignment.Center


Dim text As New TextFragment("Test TExt Topic")

text.TextState.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center
text.TextState.FontSize = 8

floater.Paragraphs.Add(text)

myPage.Paragraphs.Add(floater)


myReport.Save("Test.pdf")

Button1.Text = "done"

Hi Cameron,


Thanks for your inquiry. I have tested your shared code and notice the OutOfMemory Exception. We have logged a ticket PDFNEWNET-38787 in our issue tracking system for further investigation and resolution. We will keep you updated about the issue resolution progress within this forum thread.

We are sorry for the inconvenience caused.

Best Regards,

Hi there Ahmad,


I was wondering if this issue was resolved, and if not, what the time frame on getting this resolved would be.

Thanks,
Cameron

Hi Cameron,

Thanks for your inquiry. I have tested the scenario with Aspose.Pdf for .NET 11.0.0 and unable notice OutOfMemmory Exception anymore. Please download and try latest release of Aspose.Pdf for .NET and share the results [Aspose.Pdf for .NET][1]

Furthermore, please note Top and Left point should be within the page area and default page size of new page is A4. So for your code your page dimensions should be more than 4000 and you can set it as following. Hopefully it will resolve the issue.

....
....
Aspose.Pdf·Page myPage = myReport.Pages.Add();
myPage.PageInfo.Width = 800;
myPage.PageInfo.Height = 4100;
....
....

Best Regards,

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