I am working on a project that displays a PDF in a UIWebView. I have added another UIMenuItem to the UIMenuController in order to do various things with the text in the UIWebView that has been selected. The problem is that I am not able to access the selected text in my newly created selector method. If I use the copy command on selected text first, then I can get that previously copied text from the pasteboard, but a command like [myWebView copy:sender]; called from my new selector does nothing. How can I receive the selected text in my new selector? I know this can be done easily with javascript when working with HTML in a UIWebView, how do people usually do this with PDF files displayed in a UIWebView?
相关问题
- Correctly parse PDF paragraphs with Python
- Set BaseUrl of an existing Pdf Document
- How can I get all text from a PDF in Swift?
- Renaming named destinations in PDF files
- Write multiple lines of text in a flow with report
相关文章
- Do all browsers on iOS use WKWebview or UIWebVIew?
- Python Sendgrid send email with PDF attachment fil
- How to prevent UIWebView video from getting remote
- How to find last load of UIWebView(Ready State 4)
- C# MVC website PDF file in stored in byte array, d
- How To Programmatically Enable/Disable 'Displa
- How to reduce PDF file size programmatically in Ja
- Search and replace placeholder text in PDF with Py
You can call the copy command from the first responder using this code:
Then you can simply retrieve it from the pasteboard:
This seems to be the only way to receive the selected text from a UIWebView that is displaying a PDF, the javascript methods will not work with PDF files, only HTML.