I am trying to access strings in a pdf loaded remotely in a UIWebView . Since Apple has the copy / definition options listed for the UIMenuController elements, I thought it would be as simple as implementing the stringByEvaluatingJavaScriptFromString for use with my custom shareMenuController element. However, this works ubiquitously across most web pages and text ranges, with the exception of deleted PDF files. How does Apple access these lines to copy selected ranges to the clipboard or definition?
Correction:
I just tested the "define" sharedMenuController populated by Apple when the text was selected in the UIWebView pdf document format and an error occurred:
+ [_ UIDictionaryManager _availableDefinitionDictionaries] returns zero. Error: Domain error = Code ASError = 21 "Operation could not be completed (error ASError 21 - Unable to copy asset information)"
I also noticed that you cannot search for PDF text from a custom search term in Safari. Therefore, I believe that they have problems extracting it. There may be memory problems, I'm not sure, but they can still copy the selected text to the clipboard. How will we emulate this and process the copied text ourselves?
source share