I have tried to build a Pdfreader function to extract text from a pdf file. I am using Visual Basic 2012. I have tried numerous examples found here and elsewhere. All the examples I tried had comments indicating that the coded worked fine.
However, I always get the same error on one specific line of code:
token = New iTextSharp.text.pdf.PRTokeniser(pageBytes)
The variable pagebytes ( declared as Dim pageBytes() As Byte = Nothing, then initialized as pageBytes = reader.GetPageContent(i) ) is underlined and displays the error:
Value of type '1-dimensional array of Byte' cannot be converted to 'iTextSharp.text.pdf.RandomAccessFileOrArray'.
I copied the code exactly as found in the codebank. I have all the iTextSharp imports listed at the top of the class.
Any ideas what PRTokeniser is expecting?
However, I always get the same error on one specific line of code:
token = New iTextSharp.text.pdf.PRTokeniser(pageBytes)
The variable pagebytes ( declared as Dim pageBytes() As Byte = Nothing, then initialized as pageBytes = reader.GetPageContent(i) ) is underlined and displays the error:
Value of type '1-dimensional array of Byte' cannot be converted to 'iTextSharp.text.pdf.RandomAccessFileOrArray'.
I copied the code exactly as found in the codebank. I have all the iTextSharp imports listed at the top of the class.
Any ideas what PRTokeniser is expecting?