SetPrivilege

SetPrivilege(DocumentPrivilege)

Ställer in Pdf-filsäkerhet med tomma användar-/ägarlösenord. Ägarlösenordet kommer att läggas till med en slumpmässig sträng. Kastar ett undantag om processen misslyckades.

public bool SetPrivilege(DocumentPrivilege privilege)
ParameterTypBeskrivning
privilegeDocumentPrivilegeAnge privilegium.

Returvärde

Sant för framgång.

Exempel

[C#]
string inFile = "D:\\input.pdf"; //TestPath kan tilldelas om.
string outFile = "D:\\output.pdf"; //TestPath kan tilldelas om.
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)

Se även


SetPrivilege(string, string, DocumentPrivilege)

Ställer in Pdf-filsäkerhet med originallösenord. Kastar ett undantag om processen misslyckades.

public bool SetPrivilege(string userPassword, string ownerPassword, DocumentPrivilege privilege)
ParameterTypBeskrivning
userPasswordStringUrsprungligt användarlösenord.
ownerPasswordStringUrsprungligt ägarlösenord.
privilegeDocumentPrivilegeAnge privilegium.

Returvärde

Sant för framgång.

Exempel

[C#]
string inFile = "D:\\input.pdf"; //TestPath kan tilldelas om.
string outFile = "D:\\output.pdf"; //TestPath kan tilldelas om.
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)

Se även