C# 多个PDF文件合并 急!在线等!
下面代码的目的是将另外一个PDF文件(file2)内容追加到第一个PDF文件(file)尾,但合并的结果是第一个文件的内容被覆盖了。
System.IO.FileStream fs = new System.IO.FileStream(file.FullName,System.IO.FileMode.Append,System.IO.FileAccess.Write);
System.IO.FileStream sr = new System.IO.FileStream(file2.FullName,System.IO.FileMode.Open);
byte[] bData = new byte[sr.Length];
sr.Read(bData,0,bData.Length);
fs.Write(bData,0,bData.Length);
sr.Close();
fs.Flush();
fs.Close();
请问怎么解决被覆盖的问题。
还有如果合并成功,如何保证追加的内容是另起一页。
谢谢!