在c#.net中合并字节数组 [英] Merging Byte arrays in c#.net

查看:79
本文介绍了在c#.net中合并字节数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的表中有一列名为imageApplicant的image数据类型.我在此列中插入以字节形式存储的图像.我想将此列的内容呈现为pdf.为此,我循环遍历表中的行数并读取字节数组并创建pdf.对于表中的每条记录,我都会得到一个pdf.
我的问题是,现在我想以单个pdf呈现所有图像(而不是每个记录都为pdf)
为此,我必须合并ImageApplicant列的内容(字节数组),我不知道该怎么做,这是什么最佳解决方案...

Hi I have a column in my table named ImageApplicant of image datatype . I insert image that are stored in form of bytes in this column. I want to render content of this column as pdf. for this i loop through number of rows in my table and read byte array and create pdf. For each record in my table i am getting one pdf.
My problem is that now i want to render all images in SINGLE pdf( not a pdf for each record)
for that i have to merge content(byte array) of ImageApplicant column i dont know how to do that is there any best solution for that...

推荐答案

您可以通过查找答案如何将数组中的2个或更多字节项合并到一个字节元素 [
You can find the answers over How to merge 2 or more byte items in array to one byte element[^].
ColinE写道:

要实现所需的功能,请将每个字节数组反序列化为合适的PDF表示形式,而不是使用合适的API将文档合并在一起.

To achieve what you require, deserialize each byte array into a suitable PDF representation, than use a suitable API to merge the documents together.


Sergey Kudriavtsev写道:
Sergey Kudriavtsev wrote:

要实现您想要实现的效果,您将需要使用一些第三方C#PDF库.您可以在此SO问题的答案中找到一些指向开放源PDF库的链接 [ ^ ]或 [

To implement the effect you want to achieve you''ll need to use some 3rd party C# PDF library. You can find some links to open-source PDF libraries in answers to this SO question[^] or there[^].


[已更新]
尝试实施Sergey Kudriavtsev的
此解决方案 [ ^ ]

要合并pdf,最好的文章是简单的.NET PDF合并 [ ^ ].

谢谢...


[Updated]
Try to implement this solution by Sergey Kudriavtsev[^]

To merger pdfs, the best article to follow is Simple .NET PDF Merger[^].

Thanks...


这篇关于在c#.net中合并字节数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆