【发布时间】:2014-01-17 16:22:51
【问题描述】:
在我的应用程序中,我正在使用一些 web 服务,它返回一个base64binary 格式的 pdf 文件。在我的代码中,我将此文件作为byte[] 获取。
我的问题是如何将 2 个byte[] 合并为一个并将其正确存储为 pdf?
到目前为止,我分别存储每个 pdf 文件:
byte[] bytes = image.ImageData; // WebService that returns base64binary as byte[]
System.IO.FileStream stream = new FileStream(@"C:\Test\" + "File_" + i + ".pdf", FileMode.CreateNew);
System.IO.BinaryWriter writer = new BinaryWriter(stream);
writer.Write(bytes, 0, bytes.Length);
writer.Close();
【问题讨论】:
-
你需要一个 pdf 库。
标签: c# pdf base64 bytearray filestream