Free Support Forum - aspose.com

Aspose engine appears to not release the file under certain conditions

Aspose engine appears to not release the file under certain conditions. Here is a code snippet that would recreate the issue with some inline comments to help describe the problem.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

string pathToProtectedDocument = "C:\protectedDocument.pdf";

try

{

Aspose.Pdf.Kit.PdfAnnotationEditor pdf = new Aspose.Pdf.Kit.PdfAnnotationEditor();

pdf.BindPdf(pathToProtectedDocument);

Aspose.Pdf.Kit.PdfFileInfo fileInfo = new Aspose3rd.Pdf.Kit.PdfFileInfo(pathToProtectedDocument); //<this line will throw a IOException "Bad Password" EXPECTED

}

catch(Exception ex)

{

}

finally

{

File.Delete(pathToProtectedDocument); //This will throw a "file is still in use” Exception. NOT EXPECTED, this is the major problem here. The file will not be released until the entire process is shutdown.

}

Hi Eileen,

First of all, I would like to share with you that we have merged Aspose.Pdf.Kit for .NET into Aspose.Pdf for .NET; Aspose.Pdf.Kit for .NET have been discontinued. You may see the details in this blog post and then download the merged version. Please try the new merged Aspose.Pdf for .NET at your end.

Secondly, if you still find the same problem with the new version as well then please share the input PDF file with us, so we could investigate the issue using your particular scenario. Also, please share the details like OS, .NET framework version etc.

We’re sorry for the inconvenience and looking forward to help you out.
Regards,