Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PdfReader not opened with owner password error in iText

Tags:

c#

asp.net

itext

With reference to this

http://stackoverflow.com/questions/17524857/merging-pdf-in-asp-net-c-sharp/17525948?noredirect=1#comment25485091_17525948 

question of mine, I have user IText for merging the pdf documents. I am getting " PdfReader not opened with owner password " for some files. Any suggestions

like image 700
Ankur Avatar asked Jul 17 '13 04:07

Ankur


2 Answers

Add this code after PdfReader definition

PdfReader.unethicalreading = true;

like image 63
Mesut Başaran Avatar answered Nov 13 '22 14:11

Mesut Başaran


For iText 7 it is

PdfReader pdfReader = new PdfReader(PATH + name + ".pdf");
pdfReader.setUnethicalReading(true);

See also: itext7-how-decrypt-pdf-document-owner-password

like image 15
Ray Hulha Avatar answered Nov 13 '22 14:11

Ray Hulha