We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

PDFImage and PDFDocument memory cleanup

Hi,

I cannot find any method (Dispose, ...) to properly remove an instance of PDFImage (created from a UIImage). 
I'm generating hundreds of pdfimages for a document and ipad memory is leaking as hell. 
How do i ensure that a PDFImage instance has been disposed from memory ? 

Another question if i want to completly remove an instance of PDFDocument is using the Close(true) method is enough. 
By disposing the PDFDocument instance are childs (pages, pdfimages, ...) disposed as well ? 

Thx for your support !

3 Replies

PH Praveenkumar H Syncfusion Team August 10, 2015 05:04 AM UTC

Hi Yves ,

Thank you for using syncfusion products,

1.       Please use the below code snippet to dispose the “PdfImage” instance properly

//Loading image

PdfImage image = PdfImage.FromStream(imgStream);

//Disposing the image

(image as PdfBitmap).Dispose();


2.       The “Close(true)” method dispose PdfDocument instances and its pages, resources, but we need to dispose “PdfImages” separately as mentioned above.

Please let us know if you need further assistance.

With Regards,
Praveen


YD Yves Ducreuzet August 10, 2015 11:30 PM UTC

Thx for your support Praveen :) i will test that tomorrow and let you know if this fix my leaks (that are already partially fixed)




PH Praveenkumar H Syncfusion Team August 11, 2015 04:02 AM UTC

Hi Yves,
Thank you for your update,
We will wait to hear from you.
With Regards,
Praveen
 

Loader.
Live Chat Icon For mobile
Up arrow icon