PdfFileInfo.HasOpenPassword leads to unexpected exception

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

@AStelzner

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-58395

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.