New to Telerik Document Processing? Start a free 30-day trial
Removing Password from a PDF Using Telerik PdfProcessing
Updated on Jun 17, 2026
Environment
| Version | Product | Author |
|---|---|---|
| 2026.2.519 | RadPdfProcessing | Yoan 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.
- Use the ImportSettings property of PdfFormatProvider to supply the password for the protected PDF.
- Handle the UserPasswordNeeded or OwnerPasswordNeeded event to provide the password when required.
- Import the document into a RadFixedDocument.
- When exporting, keep ExportSettings configured so that IsEncrypted is
falseand 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);
}