PdfReader not opened with owner password error in iText
34,510
Solution 1
Add this code after PdfReader definition
PdfReader.unethicalreading = true;
Solution 2
For iText 7 it is
PdfReader pdfReader = new PdfReader(PATH + name + ".pdf");
pdfReader.setUnethicalReading(true);
See also: itext7-how-decrypt-pdf-document-owner-password
![Ankur](https://i.stack.imgur.com/gPe38.jpg?s=256&g=1)
Author by
Ankur
Updated on July 09, 2022Comments
-
Ankur almost 2 years
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 -
Pradeep over 8 yearsThanks! Worked like a charm Not sure why it would be unethical to open a file via iTextSharp if I can open it otherwise without any warning or issues :)
-
321X almost 3 yearsDon't forget that the
PdfReader
is disposable and it should be disposed afterwards or use theusing
statement