show .key(keynote) file in iphone

2.9k Views Asked by At

I am given some keynote files .

I have to put along with an app .

when I open any app it should show that keynote presentation in the app .

my questions are ,

  1. Does ios supports keynote presentation?
  2. if yes, how to show them ?

However I checked this out ...

but.. not working

http://developer.apple.com/library/ios/#qa/qa1630/_index.html

iWork '09 documents do not use a package format and must not be ZIP compressed.

To display supported documents in a UIWebView, create an NSURL as a file URL with the path to the document. Listing 1 demonstrates a method that uses a UIWebView to load a document from your application bundle.

Listing 1 Loading a document into a UIWebView.

 -(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView
 {
NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:nil];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
}

// Calling -loadDocument:inView:
[self loadDocument:@"mydocument.rtfd.zip" inView:self.myWebview];
2

There are 2 best solutions below

0
On

Alternatively, or indeed alongside the preview functionality, you can give the user the option to open the keynote using any able and installed applications externally.
There's a good answer to a question requesting this feature here: How to use "open in..." feature to iOS app?

9
On

You can open the keynote file in a UIWEBVIEW as a local bundled file or sitting on a server as well.

NSString *urlAddress = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"key"];
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];

you can view Excel (.xls), Keynote(.key.zip), numbers (.numbers.zip), pages (.pages.zip), PDF(.pdf), Powerpoint (.ppt), Word (.doc), Rich text format (.rtf), Rich text format Directory (.rtf.zip), Keynote '09(.key), numbers '09 (.numbers) and pages '09(.pages)