Open Encrypted PDF using .NET

Opening an encrypted PDF file using DynamicPDF Viewer is simple and easy. Providing the password while opening the PDF document will suffice to open the PDF.

How to open encrypted PDF file in C#

Below are the steps and sample code to open an encrypted PDF file using the Rasterizer product.

Steps for opening encrypted PDF

  1. Create a PdfDocument with the PDF file and the password.
  2. Open the file.

Sample Code - C#

PdfDocument pdfDocument = new PdfDocument(@"MyDocument.pdf", "password");

Getting Started

NuGet Package

DynamicPDF Viewer available on NuGet and is part of the ceTe.DynamicPDF.Viewer.NET package. The easiest way to install the package is through the Visual Studio Package Manager, but you can also download the package from NuGet.

NuGet Package ID: ceTe.DynamicPDF.Viewer.NET

Example Project

An example project showing this functionality can be cloned or viewed from GitHub:

Clone or View Example Project on GitHub

DynamicPDF Viewer Information

More information can be found here:

Why Choose DynamicPDF?

  • Transparent Pricing
  • Lots of Features
  • Easy to Use
  • Great Support
  • Efficient Performance
  • Product Maturity (Over 22 Years)
  • Free Evaluation
  • .NET Core Support (Most Products)
  • Flexible Licensing

We’re Not The Only Ones That Think We’re Great!