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

Free Support Forum - aspose.com

Convert Html page with 1x1 backgroud image results in System out of Memory Exception

I’m trying to convert a html-page containing a div (or body) with repeated background-image into pdf. Small background-images (like the 1x1 gif in the attached example) lead to OutOfMemoryExceptions (after consuming about 2GB of memory in my case). It doesn’t matter if the image is an inline image or linked file.

Is there a way to fix this problem (e.g. by adding some css-Information) or to use the background-image from the stylesheet as a repeated background-image of the generated pdf-file?

demo.html attached


Dim htmlLoadOptions As New Aspose.Pdf.HtmlLoadOptions()

With htmlLoadOptions

.PageInfo.IsLandscape = False

.PageInfo.Margin.Top = 0

.PageInfo.Margin.Right = 0

.PageInfo.Margin.Bottom = 0

.PageInfo.Margin.Left = 0

.PageInfo.Width = 597.6

.PageInfo.Height = 842.4

.InputEncoding = “ISO-8859-1”

End With

Dim doc As New Aspose.Pdf.Document(“demo.html”, htmlLoadOptions)

Hi Daniel,

Thanks for your inquiry. I have tested the scenario using your source HTML and managed to notice the OutOfMemoryException. So logged a ticket PDFNEWNET-38202 in our issue tracking system for further investigation and resolution. We will notify you as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,

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