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)
ParametreTipTanım
userPasswordStringOrijinal kullanıcı şifresi.
ownerPasswordStringOrijinal sahip şifresi.
privilegeDocumentPrivilegeAyrı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