Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which are the pdf operators needed to do a search feature in a PDF in iphone sdk?

I have a been trying to do a search feature in a PDF application. I read the Quartz 2d guide in iphone reference library. And so much has been said about the "pdf operators". It's by using them that everything is done, by using call-backs for them.

For info about pdf operators, we should read pdf reference of adobe. But it's very vast. Can anyone give me an idea of what these operators are (OR how to get an idea in studying them) and which of them I will require for my "search a string feature in pdf"?

like image 592
wolverine Avatar asked Nov 06 '09 11:11

wolverine


2 Answers

I've been searching for the same thing and today I found this post that has some clues:

http://www.random-ideas.net/posts/42

Looks like the operators are "TJ" and "Tj".

like image 99
Enrique R. Avatar answered Nov 06 '22 15:11

Enrique R.


Don't be scared off by the PDF reference. Its very well laid out and you really only need to read a few chapters to understand how text is handled. You can download it from Adobe:

Enrique is correct in that TJ and Tj are the operators that show text, but it is entirely possible, and even normal, for words and sentences to be split up across multiple operations. You should probably concentrate on text blocks, marked by BT and ET (begin text / end text) in the PDF Stream Object.

PDFBox from the Apache Project is a very full featured library for working with PDF documents, have a look there.

like image 45
purecharger Avatar answered Nov 06 '22 14:11

purecharger