[英]Merging several PDFs using LINQ
I would like to merge several pdfs into one我想将多个 pdf 合并为一个
My question how can I do the same with LINQ?我的问题如何使用 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;
}
if (pdfFileContentBytes.Length >=2)
{
var a = pdfFileContentBytes[0];
using (DocLib.Instance)
pdfFileContentBytes.Skip(1).ForEach(b => a=
DocLib.Instance.Merge(a,b));
return a
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.