Ankur
Ankur

Reputation: 1021

PdfReader not opened with owner password error in 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

Upvotes: 42

Views: 49854

Answers (2)

Ray Hulha
Ray Hulha

Reputation: 11221

For iText 7 it is

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

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

Upvotes: 20

Mesut Başaran
Mesut Başaran

Reputation: 977

Add this code after PdfReader definition

PdfReader.unethicalreading = true;

Upvotes: 91

Related Questions