TrySetPrivilege
PdfFileSecurity.TrySetPrivilege method
Orijinal parola ile Pdf dosyası güvenliğini ayarlar. İşlem başarısız olursa bir istisna oluşturmaz.
public bool TrySetPrivilege(string userPassword, string ownerPassword, DocumentPrivilege privilege)
Parametre | Tip | Tanım |
---|---|---|
userPassword | String | Orijinal kullanıcı şifresi. |
ownerPassword | String | Orijinal sahip şifresi. |
privilege | DocumentPrivilege | Ayrıcalık ayarlayın. |
Geri dönüş değeri
Başarı için doğru veya yanlış.
Örnekler
[C#]
string inFile = "D:\\input.pdf"; // TestPath yeniden atanabilir.
string outFile = "D:\\output.pdf"; // TestPath yeniden atanabilir.
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)
Ayrıca bakınız
- class DocumentPrivilege
- class PdfFileSecurity
- ad alanı Aspose.Pdf.Facades
- toplantı Aspose.PDF