0

Possible Duplicate:
Reading text and images from a pdf document in iOS

I have an app that currently extracts text from a PDF using PDF Kitten ( https://github.com/KurtCode/PDFKitten ). This works well, but as Kurt says, does not support all fonts.

Sometimes, the text I get back is just a collection of single characters. However, capturing text copied into the paste buffer from the same PDF works just fine.

I want to get at the same functionality Apple is using in iOS to copy text from a PDF. It has to be somewhere the Quartz framework, but I can't figure it out.

I thought of hooking into UIWebView and doing a selectAll: but UIWebView doesn't support selectAll: and there seems to be no way to turn it on.

Does anyone have experience or clues as to how to get at that text the same way the PasteBoard does?

Community
  • 1
  • 1
listing boat
  • 251
  • 1
  • 4
  • 14
  • Thank you so much. I know there are dupes, but no one has asked this series of questions in one place. I've been reading here for 3 days solid. I'm trying to provide a different perspective here. – listing boat Dec 18 '12 at 22:03
  • I see no mention of PDF Kitten in this post. I see no mention of selectAll: enablement in UIWebView. If you look at your dupe, it says there is no easy solution, but there is one that gets you 80% there - PDF Kitten. – listing boat Dec 18 '12 at 22:08
  • [This question](http://stackoverflow.com/questions/12914479/pdfkitten-is-highlighting-on-wrong-position/12932653#12932653) indicates that there were actual bugs in the determination of characters widths even of theoretically supported fonts; I don't know whether they have been fixed meanwhile. This might hinder correct collection of the characters of single words. Furthermore, if you give samples for the issues mentioned, they could be analyzed and you could enhance PDF Kitten to correctly recognize those text contents. PDF text extraction is a fickle feature anyhow... – mkl Dec 19 '12 at 00:02
  • @listingboat it is REALLY close :) And PDFKitten is just one more objC lib. sorry if you feel offended or something – Daij-Djan Dec 19 '12 at 09:37

0 Answers0