Visual Basic.NET - Recuperar pdf

 
Vista:

Recuperar pdf

Publicado por Alejandro (2 intervenciones) el 24/02/2010 18:28:23
Quisiera saber como recupero un archivo pdf de una bd sqlserver2000
he guardado el registro como campo image y bueno me da un array de bytes pero no se
como recuperar ,he intentado convertirlo en file stream no se si por allí estoy yendo bien pero se si me podrían ayudar
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Recuperar pdf

Publicado por smokalot (5 intervenciones) el 17/03/2010 12:06:47
Hola!

Yo lo hago así:

Const adTypeBinary = 1
'Create Stream object
Dim BinaryStream
Set BinaryStream = CreateObject("ADODB.Stream")
'Specify stream type - we want To get binary data.
BinaryStream.Type = adTypeBinary
'Open the stream
BinaryStream.Open
'Load the file data from disk To stream object
BinaryStream.LoadFromFile strCertificadoPDFFile

Do While (BinaryStream.Position + 1048576) < BinaryStream.Size
Response.BinaryWrite BinaryStream.Read(1048576)
Response.Flush
Loop

If (BinaryStream.Size - BinaryStream.Position) > 0 Then
Response.BinaryWrite BinaryStream.Read(BinaryStream.Size - BinaryStream.Position)
Response.Flush
End If
Set BinaryStream = Nothing

Suerte,

SMK
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar