The code I have posted takes in 5 arguments which include the location to a pdf document and a search term. The code is to parse through the PDF document and return all the matches to the keyword in the document and return their locations depending on the format (last given argument).
The code for some reason recognizes only a few words and errors on other words. I am not sure why this is.
There seems to be no difference in these words in terms of font, size location etc.