Tarun Patel
Tarun Patel

Reputation: 11

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

Upvotes: 0

Views: 2448

Answers (1)

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, e.g. to print it without password prompt.

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

Upvotes: 1

Related Questions