Retrieving selected text from a pdf file loaded into a UIWebView

We can get the selected text from the web view using

- (NSString *)selectedText {
    return [self stringByEvaluatingJavaScriptFromString:@"window.getSelection().toString()"];
}

But this will not work if I upload a PDF file. So I thought that to copy the selected text and then paste it from UIPasteboardprogrammatically. It works great when I press the copy button manually, but I do not want this to be the case. I want a copy of cade to be executed programmatically. How do i call? Or simply, How can I get a link to selected text from a PDF file loaded in a web view.

+5
source share
1 answer

, , , , UIWebView PDF , ( , ..), -

PDF - , . CGPDFDocument

UIWebView , Reader PDF. , .

PSPDFKit. . , , - , ,

, , , , ;)

0

All Articles