We recently changed PDFs to an encrypted\Secure PDF (no password needed to open in adobe reader) and now get the error: PDFReader not opened with owner password.
Using iTextSharp.LGPLv2.Core 3.4.3 with .Net 6.0 / c#
Error
MemoryStream stream = new();
PdfCopyFields copy = new(stream);
foreach (LetterTemplate t in sourceFiles)
{
//This throws the error using an encrypted PDF.
copy.AddDocument(new PdfReader(t.Data)); // t.Data is a byte array.
}
我尝试过 PdfReader.unethicalreading = true;和 pdfReader.setUnethicalReading(true); 我在看起来较旧的帖子上发现了建议,但这些属性不可用。 有没有我可以使用的新属性\方法来取代不道德的阅读?