read pdf file
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
There is something called an IFilter that can be used to read most text based files, office documents, some PDFs, images, etc.
IFilters are either installed with the OS or get installed with software. For example, MS Office Pro 2003 installs an IFilter to OCR tiff images and return the text.
As for a PDF, a PDF can be composed of images and text. Usually PDFs created directly from productivity software like MS Office, Open Office, etc. are composed of text and can readily be parsed using an IFilter. However some PDFs are composed of strictly images, scanned documents for example. These can't be easily parsed.
There may be other ways, but maybe this will help.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)