How can you select text in a PDF displayed within a UIWebView?
Can anybody tell me if it is necessary to select the text in a PDF file loaded within a UIWebView, or is it selected on its own?
If it's not selected, how can we implement the selection of tex开发者_如何学编程t within such a PDF?
The UIWebView actually draws the PDF pages as images so you don't have access to individual items (textfields, images etc.)
Highlighting isn't by far a trivial task. One solution would be to use the CGPDFScanner to parse the page's stream and figure out how to concatenate the transformations for the text operators (TJ, Tj, Tm, Tc, Tw etc.) in order to get the individual glyph positions. If you succeed in doing that the rest should be pretty straight forward.
精彩评论