0

I need to detect the text/glyph drawn on View through quartz 2d programming on touch event. Is it possible to get the text/glyph from touch points on View.

Thanks in Advance.

  • What do you mean by getting text on touching the view? – blancos Apr 23 '14 at 06:40
  • @balncos thanks for reply. By getting the text I mean I have one pdf and I want the character on the pdf page where my finger is placed on the screen. Is it possible ? – Nikita Sharma Sahu Apr 23 '14 at 14:11
  • You didn't mention 'pdf' anywhere in your question. Pdf is altogether different case in getting character by touch input and its quite difficult. So is it a pdf or simple text container on View? – blancos Apr 24 '14 at 07:32
  • It's pdf.. But will be great enough of you if u can at least guide that from where can i start .. Thanks in Advance. – Nikita Sharma Sahu Apr 26 '14 at 17:16

1 Answers1

0

I have researched according to your needs. What you need is a combination of idea that how to get pdf coordinates and then your character out of it.

Use CGPDFDocument, CGPDFScanner and CGPDFPage to scan the contents of the pdf into NSString. Then use NSString functions to find the text on that page. If multiple pages are there then you will want to store page numbers also.

This link will give you idea about how to convert pdf coordinates to iOS coordinates to get your touch point. Check out first two answers in it. Converting pdf to iOS coordinates

Community
  • 1
  • 1
blancos
  • 1,576
  • 2
  • 16
  • 38