ios - Select text from pdf in webview -


I am creating a PDF using images from UIGraphicsBeginPDFPageWithInfo , then add that PDF to a < Code> Loading UIWebView .

I want to select some text from that PDF and it has to be shown on a textview. Here is a code sample that I am using to load a PDF on a web view.

NSArray * path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES); NSString * Document Directory = [Path ObjectExtends: 0]; NSString * filePath = [Document Directory stringbapensitting path comparison: @ "images pdf"]; NSURL * pdfUrl = [NSU file file path: filepath]; NSLog (@ "PDF URL:% @", PDF url); NSURLRequest * Request = [NSRR request request with url: pdfUrl]; [_webView loadRequest: request];

I have tried to use the following, but it is returning an empty string.

  NSString * innerText = [_webView stringGeviling JavaScript scripting frame: @ "document.body innerText"];  

EDIT: I have selected text selection functionality as in ibooks.

Can you see this example in gitHub:


Comments