Using iTextSharp to change Page Extraction property to allow in ASP.Net

Last Reply 9 months ago By dharmendr

Posted 9 months ago

Hi,

This question is based on the plugin itextsharp. I need to change only the pdf extraction properties. Rest of the property I can able to change. Please see my code below after the image which is taken from below site. The Actual issue was well explained in below link.

 https://developers.itextpdf.com/question/how-allow-page-extraction-when-setting-password-security

 

using iTextSharp.text.pdf;
 
using (Stream input = new FileStream(InputFile, FileMode.Open, FileAccess.Read, FileShare.Read))
{
      using (Stream output = new FileStream(OutputFile, FileMode.Create, FileAccess.Write, FileShare.None))
      {
            PdfReader reader = new PdfReader(input);
            PdfEncryptor.Encrypt(reader, output, true, userpwd, masterpwd,PdfWriter.AllowScreenReaders);
       }
}