【发布时间】:2019-12-18 01:58:07
【问题描述】:
我使用 iTextSharp 来合并来自字节数组的两个文档,如下所示:
using (MemoryStream ms = new MemoryStream())
using (Document doc = new Document())
using (PdfSmartCopy copy = new PdfSmartCopy(doc, ms))
{
// Open document
doc.Open();
// Create reader from bytes
using (PdfReader reader = new PdfReader(pdf1.DocumentBytes))
{
//Add the entire document instead of page-by-page
copy.AddDocument(reader);
}
// Create reader from bytes
using (PdfReader reader = new PdfReader(pdf2.DocumentBytes))
{
//Add the entire document instead of page-by-page
copy.AddDocument(reader);
}
// Close document
doc.Close();
// Return array
return ms.ToArray();
}
由于一堆东西发生了变化,我无法将其转换为 iText 7。有人会这样给我正确的方向吗?提前非常感谢!
【问题讨论】: