Hello,
we need to check whether a PDF is password protected. Here’s how we do it:
using (var pdfFileInfo = new PdfFileInfo(InputFile))
{
return pdfFileInfo.HasOpenPassword;
}
When obtaining the value of “pdfFileInfo.HasOpenPassword” leads to a unexpected exception with attached PDF (we use the latest Aspose.PDF version 24.10.0):
System.NullReferenceException: ‘PdfFileInfo is not initialized. Use constructors with parameters or properties for initialization. (File: C:_Data\PdfKennwortschutz\Komischer PW Schutz.pdf) (Reason: Permissions check failed (invalid Perms value).)’
Komischer PW Schutz.pdf (290,4 KB)
Kind Regards,
Andy