TrySetPrivilege
PdfFileSecurity.TrySetPrivilege method
Imposta la sicurezza del file Pdf con la password originale. Non genera un’eccezione se il processo non riesce.
public bool TrySetPrivilege(string userPassword, string ownerPassword, DocumentPrivilege privilege)
Parametro | Tipo | Descrizione |
---|---|---|
userPassword | String | Password utente originale. |
ownerPassword | String | Password originale del proprietario. |
privilege | DocumentPrivilege | Imposta il privilegio. |
Valore di ritorno
Vero per il successo o falso.
Esempi
[C#]
string inFile = "D:\\input.pdf"; //Il TestPath potrebbe essere riassegnato.
string outFile = "D:\\output.pdf"; //Il TestPath potrebbe essere riassegnato.
PdfFileSecurity fileSecurity = new PdfFileSecurity(inFile,outFile);
bool result = fileSecurity.TrySetPrivilege(userPassword, ownerPassword, DocumentPrivilege.Print);
[Visual Basic]
Dim inFile As String = "D:\\input.pdf" 'The TestPath may be re-assigned.'
Dim outFile As String = "D:\\output.pdf" 'The TestPath may be re-assigned.'
Dim fileSecurity As PdfFileSecurity = New PdfFileSecurity(inFile,outFile)
Dim result As Boolean = fileSecurity.TrySetPrivilege(userPassword, ownerPassword, DocumentPrivilege.Print)
Guarda anche
- class DocumentPrivilege
- class PdfFileSecurity
- spazio dei nomi Aspose.Pdf.Facades
- assemblea Aspose.PDF