将Byte()数组保存到光盘 [英] Save an Array of Byte() to a Disc

查看:77
本文介绍了将Byte()数组保存到光盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好.
我遇到的情况不是如何解决.
当前,我有一个Web服务,该服务可生成PDF文件,将其转换为BYTE()数组,并作为结果返回.
在ASP.NET中.我毫不费力地转换了PDF中的字节数组()并在导航器中显示了它.然后发送要由用户打印的PDF.

现在我正在开发应用程序(WindowsForms),必须在PictureBox或丝网印刷中显示PDF文件.

我已经在我的应用程序中引用了Web服务,这就是我的工作:

Good morning.
I have a situation that is not how to solve.
Currently I have a webservice that generates a PDF file, converts it to an array of BYTE () and returns as a result.
In ASP.NET. I had no trouble converting the byte array () in the PDF and display it in the Navigator. and then send the PDF to be printed by the user.

now I''m developing an application (WindowsForms) must display the PDF file in a PictureBox or a screen printing

I have referenced the web service in my application and this is what I do:

Dim WsAuto As New WsPDF.AutosSoapClient 'this reference has a PDF Method: WsAuto.PDF()
Dim Ws As New WsPDF.DataAuto ' this one, is to Fill the data in the PDF File
Ws.Nombre1 = "NAME OF DRIVER" 'Poliza.NombreConductor
Ws.Licencia1 = "DRIVER NUMBER" 'Poliza.NoLicencia
Ws.FechaNacimiento1 = "1983-09-27" ' Poliza.FechaNacimiento
Ws.Ocupacion1 = "Systems" 'Poliza.Ocupacion
pboxImagen.Image = Image.FromStream(New MemoryStream(WsAuto.PDF(Ws, WsPDF.TipoPoliza.Resto)))
'WsPDF.TipoPoliza.Resto, is only for select the template the options are: 1,2 and 99



那是我的问题
我不知道如何将字节数组()传递给图片框或打印文档.



that''s my problem
I do not know how to pass an array of bytes () to a picturebox or Print Document.
regards.

推荐答案

我不认为您可以直接将包含PDF的字节数组放入图片框.您必须首先将PDF转换为图像.您为什么不将PDF保存到一个临时位置,然后只用Adobe打开它呢? (是的,这要求用户具有Adobe Reader……但这不再是太苛刻的要求.大多数人已经在计算机上安装了Adobe Reader.)
I don''t think you can just directly put an array of bytes that contains an PDF into an picture box. You''d have to first convert the PDF into an image. Why don''t you instead save the PDF to a temporary location and then just open it with adobe? (Yes, this requires users to have adobe reader...but that''s not too drastic a requirement anymore. Most people already have it on their computers.)


这篇关于将Byte()数组保存到光盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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