ByteScout Premium Suite - C# - Remove password and protection from pdf with pdf sdk - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Premium Suite – C# – Remove password and protection from pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – C# – Remove password and protection from pdf with pdf sdk

How to remove password and protection from pdf with pdf sdk in C# with ByteScout Premium Suite

Learn to remove password and protection from pdf with pdf sdk in C#

The coding instructions are formulated to help you to try-out the features without the requirement to write your own code. Want to remove password and protection from pdf with pdf sdk in your C# app? ByteScout Premium Suite is designed for it. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording.

The following code snippet for ByteScout Premium Suite works best when you need to quickly remove password and protection from pdf with pdf sdk in your C# application. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Applying C# application mostly includes various stages of the software development so even if the functionality works please test it with your data and the production environment.

ByteScout Premium Suite free trial version is available on our website. C# and other programming languages are supported.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using Bytescout.PDF; using System; namespace RemovePdfProtection { class Program { static void Main(string[] args) { try { //Files string fileName = "ProtectedPDFFile.pdf"; string fileName_UnProtected = "UnProtectedPDFFile.pdf"; //Protected file password string filePassword = "admin@123"; //Process file to remove password using (Document document = new Document()) { document.RegistrationName = "demo"; document.RegistrationKey = "demo"; document.Load(fileName, filePassword); // Remove password protection and encryption document.Security.OwnerPassword = String.Empty; document.Security.UserPassword = String.Empty; document.Security.EncryptionAlgorithm = EncryptionAlgorithm.None; // Remove restrictions document.Security.AllowAccessibilitySupport = true; document.Security.AllowAssemlyDocument = true; document.Security.AllowContentExtraction = true; document.Security.AllowFillForms = true; document.Security.AllowModifyAnnotations = true; document.Security.AllowModifyDocument = true; document.Security.AllowPrintDocument = true; document.Security.PrintQuality = PrintQuality.HightResolution; //Save Unprotected file document.Save(fileName_UnProtected); } Console.WriteLine("PDF restrictions removed successfully!"); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.WriteLine(); Console.WriteLine("Press any key to exit...."); Console.ReadLine(); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next