我正在使用 EVOPDF 库将多个 PDF 文档合并为一个 PDF 文档。
当输入的 PDF 文档有所有者密码时,输出的文档只包含空白页。
我看到 itext7 具有使用以下行删除所有者密码的功能: reader.SetUnethicalReading(true);
这如何在 EVOPDF 或使用免费或开源库中完成?因为使用 itext7 您需要为商业用途付费,而我已经为 EVOPDF 许可证付费。
当 PDF 文档不包含所有者密码或我手动删除它们时,合并工作正常
List<Byte[]> totalBytes = new List<byte[]>();
byte[] pdfBytes = null;
//Populate the totalBytes List with the PDF byte arrays
MemoryStream ms1 = new MemoryStream(totalBytes[0])
MemoryStream ms2 = new MemoryStream(totalBytes[1])
pdfMerge.AppendPDFStream(ms1);
pdfMerge.AppendPDFStream(ms2);
pdfBytes = pdfMerge.RenderMergedPDFDocument();
Response.Clear();
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "filename=" + savedFilename);
Response.AddHeader("Content-Length", pdfBytes.Length.ToString());
Response.BinaryWrite(pdfBytes.ToArray());
pdfBytes = null;
Response.Flush();
Response.Close();
Response.End();