简体   繁体   English

使用PDFsharp C#以编程方式在加密的pdf文件上输入密码

[英]Programatically enter password on encrypted pdf file using PDFsharp C#

I need to open a secured password protected PDF files programatically in ASP.NET using C# 我需要使用C#在ASP.NET中以编程方式打开受密码保护的受保护的PDF文件

I don't want to enter the password manually when it opens. 打开时,我不想手动输入密码。 When the file is downloaded to the local drive it must ask the password to download or print the file. 将文件下载到本地驱动器时,必须询问密码才能下载或打印文件。

I am using PDFsharp 我正在使用PDFsharp

You can specify the password in the call to PdfReader.Open to open the document. 您可以在对PdfReader.Open的调用中指定密码以打开文档。 You can then create an unprotected copy of the PDF, eg to print it without password prompt. 然后,您可以创建不受保护的PDF副本,例如在没有密码提示的情况下进行打印。

See also: 也可以看看:
http://www.pdfsharp.net/wiki/UnprotectDocument-sample.ashx http://www.pdfsharp.net/wiki/UnprotectDocument-sample.ashx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM