SetPrivilege
Innehåll
[
Dölj
]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)
Parameter | Typ | Beskrivning |
---|---|---|
privilege | DocumentPrivilege | Ange 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
- class DocumentPrivilege
- class PdfFileSecurity
- namnutrymme Aspose.Pdf.Facades
- hopsättning Aspose.PDF
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)
Parameter | Typ | Beskrivning |
---|---|---|
userPassword | String | Ursprungligt användarlösenord. |
ownerPassword | String | Ursprungligt ägarlösenord. |
privilege | DocumentPrivilege | Ange 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
- class DocumentPrivilege
- class PdfFileSecurity
- namnutrymme Aspose.Pdf.Facades
- hopsättning Aspose.PDF