简体   繁体   中英

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#

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

You can specify the password in the call to PdfReader.Open to open the document. You can then create an unprotected copy of the PDF, eg to print it without password prompt.

See also:
http://www.pdfsharp.net/wiki/UnprotectDocument-sample.ashx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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