Posted by a ceTe Software moderator
Hello,
The feature to detect whether an existing PDF is protected with a user or owner password is included in latest release, DynamicPDF for .NET v10.28. You can download latest from Nuget (product ID: ceTe.DynamicPDF.CoreSuite.NET) or from our website
here.
Here is a code sample:
EncryptionInfo info = PdfDocument.GetEncryptionInfo("PDF file path or byte array");
bool hasOwnerPasword = info.HasOwnerPassword;
bool hasUserPassword = info.HasUserPassword;
Thanks,
ceTe Software Support Team