iphone - Disable hyperlinks in PDF file in UIWebView -


i have webview pdf file , document in contains hyperlinks want disable. tried using approach didn't work, links still open , load nasty urls:

  1. i put uiwebviewdelegate in viewcontroller.h
  2. i put code in viewcontroller.m:
- (bool)webview:(uiwebview *)webview shouldstartloadwithrequest:(nsurlrequest *)request navigationtype:(uiwebviewnavigationtype)navigationtype {     if (webview == myreadingarticleswebview) {         return no;     }     else {         return yes;     } } 

any ideas how make simple , easy work? admit make mistakes in process described above.

edit:

- (bool)webview:(uiwebview *)webview shouldstartloadwithrequest:(nsurlrequest *)request navigationtype:(uiwebviewnavigationtype)navigationtype {     if ([request.url isfilereferenceurl]) {         return yes;     } else {         return no;     } } 

the code above nothing me well

if trumpetlicks says pdf viewer ignores shouldstartloadwithrequest, , if don't want disable links (which setting datadetectors do).

then else try creating class derived nsurlprotocol , registering in app delegate. able intercept network traffic originating pdf , give chance filter links , stop ones don't want going out.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -