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

Last Reply one year ago By dharmendr

Posted one year ago


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.


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);