Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27355

[RESOLVED] Error in ParsePdfText() function

$
0
0
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?

Viewing all articles
Browse latest Browse all 27355

Trending Articles