Pdf | |
The PdfSecurityInfo type exposes the following members.
| Name | Description | |
|---|---|---|
| Algorithm | Gets the encryption algorithm. Meaningful only when IsEncrypted is true. | |
| CanAccessibilityCopyContent | Gets a flag indicating if content can be extracted for accessibility. | |
| CanAssembleDocument | Gets a flag indicating if pages can be inserted, rotated or deleted. | |
| CanCopyContent | Gets a flag indicating if content can be copied. | |
| CanEditAnnotations | Gets a flag indicating if annotations can be added or changed. | |
| CanEditContent | Gets a flag indicating if the content can be changed. | |
| CanFillFormFields | Gets a flag indicating if form fields can be filled in. | |
| CanFullQualityPrint | Gets a flag indicating if the document can be printed at full quality. | |
| CanPrint | Gets a flag indicating if the document can be printed. | |
| CertificationLevel | Gets the changes the certification allows; None when the document is not certified. | |
| IsCertified | Gets a flag indicating if the document is certified (its first signature is a certification). | |
| IsEncrypted | Gets a flag indicating if the document is encrypted. | |
| IsMetadataEncrypted | Gets a flag indicating if the XMP metadata is encrypted with the document. | |
| IsOwnerPasswordRequired | Gets a flag indicating if the owner password is needed for full access to the document: the document is encrypted and at least one permission is denied. | |
| IsSigned | Gets a flag indicating if the document carries at least one signature. | |
| IsUserPasswordRequired | Gets a flag indicating if a password is needed to open the document (it has a user password). | |
| KeyLength | Gets the encryption key length in bits; 0 when the document is not encrypted. | |
| KeySize | Gets the encryption key size. Meaningful only when IsEncrypted is true. | |
| PermissionFlags | Gets the raw permission flags of an encrypted document (the P entry of the encryption dictionary, ISO 32000); -1 (every permission) when the document is not encrypted. | |
| Revision | Gets the revision of the security handler (2 to 6); 0 when the document is not encrypted. | |
| SecurityHandler | Gets the name of the security handler (normally Standard); empty when the document is not encrypted. | |
| SignatureCount | Gets the number of signatures the document carries. |
PdfSecurityManager manager = new PdfSecurityManager(); manager.Load("document.pdf", "password"); PdfSecurityInfo info = manager.GetSecurityInfo(); if (info.IsEncrypted) System.Console.WriteLine(info.Algorithm + " " + info.KeyLength + "-bit"); System.Console.WriteLine("signatures: " + info.SignatureCount); manager.Close();