documentReader.IsOpenedWithFullPermissions
pdfsdoc.SecuritySettings.HasOwnerPermissions
|
//Load the existing PDF document.
PdfLoadedDocument ldoc = new PdfLoadedDocument("Barcode-protected.pdf", "password");
//Get owner password
if(ldoc.Security.OwnerPassword != string.Empty)
{
Console.WriteLine("Document opened with full permission");
}
else
{
Console.WriteLine("Document opened with partial");
}
|
|
Password Type |
User Password
(ldoc.Security.UserPassword) |
Owner Password
(ldoc.Security.OwnerPassword) |
|
If Owner password and User Password is set to the PDF and opened the document with User password |
Returns User Password |
Returns Null |
|
If Owner password and User Password is set to the PDF and opened the document with Owner password |
Returns User Password |
Returns Owner Password |
|
If Owner password is set to the PDF |
Returns Null |
Returns Owner Password |
|
If User password alone is set to the PDF |
Returns User Password |
Returns Owner Password (Owner password is same as the user password; it allows user to full permission). |