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.
}