Home

Bytescout.PDF for .NET


 Products  |  Download  |  Purchase  |  Support  |  Contacts  |  Testimonials |  
Bytescout.PDF library for .NET

Download Free Trial Buy Now More Information
For HTML2PDF and XML2PDF solution check our PDFDoc Scout ActiveX library instead

Removing protection (password and security permissions) from existing PDF document using Bytescout.PDF library

This example demonstrates how to remove protection and security settings from existing PDF document using Bytescout.PDF library

Download example source code: bytescoutpdf_remove_protection_from_existing_pdf.zip (10 KB)

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Bytescout.PDF;

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{

// Create main PDF Doc Engine
PDFDocEngine engine = new PDFDocEngine("", "");

// Add existing document
Document document = engine.AddDocument("HelloWorldWithSecurity.pdf");

// check if document is protected
if (document.Protected)
{
// check password
if (document.ValidatePassword("123") == PasswordValidationType.Invalid)
{
Console.WriteLine("Invalid password");
}
else // removing protection if password was correct
document.RemoveProtection();
}

// Save document
document.Save("HelloWorldWithSecurity_ProtectionRemoved.pdf");

}
}
}


Download example source code: bytescoutpdf_remove_protection_from_existing_pdf.zip (10 KB)

Download Free Trial Buy Now More Information
For HTML2PDF and XML2PDF solution check our PDFDoc Scout ActiveX library instead

"Hello, World!" quick start step-by-step tutorials:

Advanced Examples:

"Hello, World!" quick start step-by-step tutorials:

Advanced Examples:
Products  |  Download  |  Purchase  |  Support  |  Contacts  |  Testimonials |  

ByteScout, 2003-2008. All other company and product names may be trademarks of their respective companies. Privacy Statement