C# iText 中的所有者密码错误未打开 PdfReader

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17691013/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 10:11:55  来源:igfitidea点击:

PdfReader not opened with owner password error in iText

c#asp.netitext

提问by Ankur

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

我的问题,我有用户 IText 来合并 pdf 文档。我正在获取" PdfReader not opened with owner password "一些文件。有什么建议

回答by Mesut Ba?aran

Add this code after PdfReader definition

在 PdfReader 定义之后添加此代码

PdfReader.unethicalreading = true;

PdfReader.unethicalreading = true;

回答by Ray Hulha

For iText 7 it is

对于 iText 7,它是

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

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

另见: itext7-how-decrypt-pdf-document-owner-password