Is there a way to get the text coordinates from a PDF file on the iPhone?
Thanks,
Nav
More: I am trying to get words from a pdf file and select them. Although this is a fairly simple task in Mac OS X that has PDFKit, it is not so trivial on the iPhone, which has a set of Quartz functions for presenting and receiving information from a pdf file. So far, I have tried and succeeded in the following: get a list of words from a pdf file, looking at its contents and using Tj and TJ operators (see how to search for text in pdf ). While Tj gives a string, and I can get words from it, TJ is an array of glyphs, probably because most of its members come as separate characters, but joining them together gives a string, and I can get words from there.
Now my problem is to highlight the found words, which can be done by searching for the TD / Td operators and trying to calculate the character boxes myself, but for this I probably need to get the font / style and other characteristics of the glyphs so that I can correctly calculate glyph blocks. And, probably, somehow to build a transformation matrix or something like this ... Can anyone shed some light?
source share