我找到了这个link。
我想将多个pdf合并为一个
我的问题如何使用LINQ进行相同操作?
if (pdfFileContentBytes.Length >=2)
{
byte[] a = pdfFileContentBytes[0];
for (int i = 1; i < pdfFileContentBytes.Length; i++)
{
using (var library = DocLib.Instance)
{
byte[] b = pdfFileContentBytes[i];
byte[] temp = a;
a = library.Merge(temp, b);
}
}
System.IO.File.WriteAllBytes("myfile4.pdf", a);
return a;
}
答案 0 :(得分:0)
if (pdfFileContentBytes.Length >=2)
{
var a = pdfFileContentBytes[0];
using (DocLib.Instance)
pdfFileContentBytes.Skip(1).ForEach(b => a=
DocLib.Instance.Merge(a,b));
return a
}