The below example would explain on how to Display a PDF document in browser using ASP.NET/VB.NET
Dim Fs As FileStream
Dim FileSize As Long
Dim filePath As String = "C:\Test.Pdf"
'Open the file.
Fs = New FileStream(filePath, FileMode.Open)
FileSize = Fs.Length
'Convert the file into array of bytes.
Dim Buffer(CInt(FileSize)) As Byte
Fs.Read(Buffer, 0, CInt(FileSize))
Fs.Close()
'Write the binary content directly to the HTTP Output Stream.
Response.ContentType = "application/pdf"
Response.OutputStream.Write(Buffer, 0, FileSize)
Response.Flush()
Response.Close()
Hi,
ReplyDeleteI use PDF Duo .NET converting component for create/convert HTML to PDF. This component doesn't use any additional software.
It is very easy in use and has a method to show a PDF after converting. More details see on web page www.duodimension.com
Regards,
Mike