Jump to content

read pdf file


joecool2005

Recommended Posts

Hi,The following code reads a text file and it displays the content.Is it possible to read and display a pdf file as a string?

			Dim s As String			Dim fileName As String			fileName = "test.txt"		 						Dim stream As IO.StreamReader			stream = New IO.StreamReader(fileName)			s = stream.ReadToEnd().ToString			Response.Write(s)

Thx!

Link to comment
Share on other sites

Thanks for your help!How can I display the content as string? It showed me numbers

			Dim ReadPdf As New IO.FileStream("D:\test.pdf", IO.FileMode.Open)			Dim FileSize As Long = ReadPdf.Length			Dim Buffer(FileSize) As Byte			ReadPdf.Read(Buffer, 0, Buffer.Length)			ReadPdf.Close()			'I don't know how to display the content as string			Dim i As Integer			For i = 0 To Buffer.Length - 1				Response.Write(Buffer(i).ToString)			Next

Thx

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...