TryDecryptFile
PdfFileSecurity.TryDecryptFile method
Dekrypterar ett krypterat PDF-dokument med ägarlösenord. Om dokumentet inte har ägarlösenord, är det tillåtet att använda användarlösenord. Ger inget undantag om processen misslyckades.
public bool TryDecryptFile(string ownerPassword)
Parameter | Typ | Beskrivning |
---|---|---|
ownerPassword | String | Ägarlösenord. |
Returvärde
Sant för framgång, eller falskt.
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);
bool result = fileSecurity.TryDecryptFile("ownerpass");
[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.TryDecryptFile("ownerpass")
Se även
- class PdfFileSecurity
- namnutrymme Aspose.Pdf.Facades
- hopsättning Aspose.PDF