Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

John Baughman

macrumors regular
Original poster
Oct 27, 2003
100
0
Given a pdf created with pages that includes working imbedded hyperlink, stored as a resource with my app and displayed in a UIWebView, what needs to be done to make the hyperlink work in in the UIWebView.

Scouring the posts here and elsewhere on this subject it appears that a link should just work if you want it to display in Safari. I can't get them to work.

In pages I created the document and created a hyperlink to http://www.excite.com/ for testing purposes. I then exported the document as a pdf. The link works fine when the pdf is displayed in Preview. I then added the pdf to my app resources folder and loaded it into the UIWebView. The link does not work.

The UIWebView was created with IB and I have the Links property checked.
I am loading the pdf with the following code...


Code:
NSString *pdfPath =[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[documents objectAtIndex:documentNumber]];
pdfUrl = [NSURL fileURLWithPath:pdfPath];

[webView loadRequest:[NSURLRequest requestWithURL:pdfUrl]];

What more do I need to do?

For now I just would like the link to open in Safari. Eventually I will need to have links that allow me to link to other pdfs in my resource folder and display them in the same UIWebView. To do this I understand I will need to implement a UIWebViewDelegate.

Thanks,
John
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.