How to load from byte array

How to load from byte array

Forum member · Dec 14, 2012
I am pulling the PDF from my database. How do I load the PDF?

Re: How to load from byte array

Support · Dec 14, 2012
Hello, Below sample code shows how to load the PDF byte array. 'read the PDF file into a byte array Dim objStream Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open objStream.Type = 1 'Type of stream file objStream.LoadFromFile Server.MapPath( "./DocumentB.pdf" ) Dim MyData MyData = objStream.Read 'create a PdfDocument object Dim pdf Set Pdf = Server.CreateObject( "DynamicPdf.PdfDocument" ) 'load the byte data into the PdfDocument pdf.LoadPdf MyData 'create merge document using the PdfDocument Dim MyDataDocument Set MyDataDocument = Server.CreateObject( "DynamicPDF.Document" ) MyDataDocument.LoadPdf pdf 'draw to web page MyDataDocument.DrawToWeb Thanks, ceTe Software Support Team.