PdfFileSecurity.DecryptFile

PdfFileSecurity.DecryptFile 方法

通过所有者密码解密加密的 Pdf 文档。如果文档没有所有者密码,则允许使用用户密码。如果处理失败,则抛出异常。

public bool DecryptFile(string ownerPassword)
参数类型描述
ownerPassword字符串所有者密码。

返回值

成功返回 true。

示例

[C#]
string inFile = "D:\\input.pdf"; //The TestPath may be re-assigned.
string outFile = "D:\\output.pdf"; //The TestPath may be re-assigned.	
PdfFileSecurity fileSecurity = new PdfFileSecurity(inFile,outFile);		
fileSecurity.DecryptFile("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) 
fileSecurity.DecryptFile("ownerpass")

另请参阅