SetPrivilege

SetPrivilege(DocumentPrivilege)

Boş kullanıcı/sahip parolalarıyla Pdf dosyası güvenliğini ayarlar. Sahip parolası rastgele bir dizeyle eklenecektir. İşlem başarısız olursa bir istisna atar.

public bool SetPrivilege(DocumentPrivilege privilege)
ParametreTipTanım
privilegeDocumentPrivilegeAyrıcalık ayarlayın.

Geri dönüş değeri

Başarı için doğru.

Örnekler

[C#]
string inFile = "D:\\input.pdf"; // TestPath yeniden atanabilir.
string outFile = "D:\\output.pdf"; // TestPath yeniden atanabilir.
PdfFileSecurity fileSecurity = new PdfFileSecurity(inFile,outFile);		
fileSecurity.SetPrivilege(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) 
fileSecurity.SetPrivilege(DocumentPrivilege.Print)

Ayrıca bakınız


SetPrivilege(string, string, DocumentPrivilege)

Orijinal parola ile Pdf dosyası güvenliğini ayarlar. İşlem başarısız olursa bir istisna atar.

public bool SetPrivilege(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.

Örnekler

[C#]
string inFile = "D:\\input.pdf"; // TestPath yeniden atanabilir.
string outFile = "D:\\output.pdf"; // TestPath yeniden atanabilir.
PdfFileSecurity fileSecurity = new PdfFileSecurity(inFile,outFile);		
fileSecurity.SetPrivilege(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) 
fileSecurity.SetPrivilege(userPassword, ownerPassword, DocumentPrivilege.Print)

Ayrıca bakınız