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

Free Support Forum - aspose.com

If Pdf is Encrypted, Using PdfFileInfo & Document leads to locked files

Hi Team,

We were checking if Pdf file is encrypted using PdfFileInfo.isEncrypted() method.
During the process, we encountered the below issue:

For Password protected pdf documents, if we use PdfFileInfo or Document and initialize it without providing password, it leads to locked files by Java Application.
Aspose doesn’t release Pdf file from Java memory even after calling cleanup methods like:
PdfFileInfo.dispose, PdfFileInfo.close, Document.dispose, Document.close

This issue is only for Password Protected PDF files.
Please find the attached code snippet and protected Pdf used.

Similar issue was raised earlier for invalid Pdf file. Below is link for the same:

a-pdf-password-security-doc-protected.pdf (426.9 KB)
PdfFileLockedByJavaApplication.JPG (25.8 KB)
withDocumentLockedFile.JPG (96.7 KB)
withoutPasswordLockedFile.JPG (15.4 KB)



Thanks for contacting support.

Would you kindly share the password of the document you have shared. We will further test the scenario in our environment and address it accordingly.