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

Free Support Forum - aspose.com

Cells Save as xml not releasing image files


I have an issue where I save a worksheet to pdf xml in a temp directory, bind a pdf to it, save the pdf then try to delete the temp directory. My problem is that a logo in the worksheet is saved as a separate image with the xml, then when I go to delete the temp directory it tells me the image is in use by another process.

Of course, it isn’t, so is the pdf save hanging on to it for too long? do I need to pdf.close of some such?

Heres a sample of my code:

’ save as xml
work.Save(tempdir & xmlfile, Aspose.Cells.FileFormatType.AsposePdf)
’ Open as PDF from XML
pdf.BindXML(tempdir & xmlfile, Nothing)
’ Write to Network share
pdf.Save(pdfDir & pdffile)
’ Cleanup
System.IO.Directory.Delete(tempdir, True)


Could you simply remove the coding lines related Aspose.Pdf component APIs to check if it causes this issue.


' save as xml
work.Save(tempdir & xmlfile, Aspose.Cells.FileFormatType.AsposePdf)
' Cleanup
System.IO.Directory.Delete(tempdir, True)

Thank you.

When I remove the pdf code, the tempdir is cleaned out without error.

So, it is indeed, the pdf save that is not releasing the image file.


Will there be any progress on this issue soon?

Just to review, saving as XML then deleting works.

Saving the xml as a pdf then deleteing doesn’t work.

As you said, this is a Pdf product’s issue so I move your post to pdf forum. Our pdf team will support you soon.


I have tested this with Aspose.Pdf v and was not able to reproduce the error. Which version are you using.


I installed that version yesterday for a different issue.

But lo and behold, it works for the deletion now. Good O!