New to Telerik Document ProcessingStart a free 30-day trial

Removing Password from a PDF Using Telerik PdfProcessing

Updated on Jun 17, 2026

Environment

VersionProductAuthor
2026.2.519RadPdfProcessingYoan Karamanov

Description

Use RadPdfProcessing to open a password-protected PDF file and save it again as a new document without password protection or encryption.

This knowledge base article also answers the following questions:

  • How to open a password-protected PDF and save it without a password?
  • How to remove password protection from a PDF using Telerik PdfProcessing?
  • How to create a non-encrypted PDF from a password-protected file?

Solution

To remove a password from a PDF using PdfFormatProvider, import the password-protected document with PdfImportSettings, then export it with PdfExportSettings without encryption.

  1. Use the ImportSettings property of PdfFormatProvider to supply the password for the protected PDF.
  2. Handle the UserPasswordNeeded or OwnerPasswordNeeded event to provide the password when required.
  3. Import the document into a RadFixedDocument.
  4. When exporting, keep ExportSettings configured so that IsEncrypted is false and leave UserPassword and OwnerPassword unset.

The following example demonstrates this process:

csharp
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf;
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import;
using Telerik.Windows.Documents.Fixed.Model;
using System.IO;

// Create PdfFormatProvider and configure import settings
PdfFormatProvider provider = new PdfFormatProvider();
PdfImportSettings settings = new PdfImportSettings();
bool isPasswordProtected = false;

// Handle UserPasswordNeeded event
settings.UserPasswordNeeded += (s, a) =>
{
    isPasswordProtected = true;
    a.Password = "YourPasswordHere"; // Supply the user password
};

// Handle OwnerPasswordNeeded event
settings.OwnerPasswordNeeded += (s, a) =>
{
    isPasswordProtected = true;
    a.Password = "OwnerPasswordHere"; // Supply the owner password
};

provider.ImportSettings = settings;

// Import the password-protected PDF
RadFixedDocument document;
using (Stream stream = File.OpenRead("input.pdf"))
{
    document = provider.Import(stream);
    // Document is loaded if the password is correct
}

// Configure export settings
provider.ExportSettings.IsEncrypted = false; // Ensure no encryption

// Export the document to a new PDF file
string pdfOutputPath = "output.pdf";
File.Delete(pdfOutputPath);
using (Stream output = File.OpenWrite(pdfOutputPath))
{
    provider.Export(document, output);
}

See Also