Reputation: 61
I'm trying to write application which will be able to display MS Word docs, MS PowerPoint presentations(ppt). Is there some kind of support for those formats. I know that mail application can open PowerPoint. If there is no support for it what approach should i take ? Thanks in advance.
Upvotes: 2
Views: 3475
Reputation: 931
You can use UIWebView to display documents.
Or There are two ways to preview documents: one is to use UIDocumentInteractionController's preview API, the other is directly use QLPreviewController.
Check this link from Apple for more details and source code-
Upvotes: 1
Reputation: 4344
For opening anything (PDF, Pages, Word, Numbers, Excel, Images etc) that the Mail.app or Safari can open, you usually use the UIWebView
.
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0.0F, 0.0F, 320.0F, 480.0F)];
NSURL *pdfURL = [NSURL URLWithString:@"http://www.something.com/myFile.pdf"];
NSURLRequest *request = [NSURLRequest requestWithURL:pdfURL];
[webView loadRequest:request];
[self.view addSubview:webView];
[webView release];
More info here: http://developer.apple.com/iphone/library/qa/qa2008/qa1630.html
iPhone 2.2.1 supports:
* Excel (.xls)
* Keynote (.key.zip)
* Numbers (.numbers.zip)
* Pages (.pages.zip)
* PDF (.pdf)
* Powerpoint (.ppt)
* Word (.doc)
iPhone 3.0 (the min version required to get into App store today?) adds support to:
* Rich Text Format (.rtf)
* Rich Text Format Directory (.rtfd.zip)
* Keynote '09 (.key)
* Numbers '09 (.numbers) Pages '09 (.pages)
Upvotes: 2
Reputation: 5205
That's relatively easy. UIWebView is able to load office documents.
All you have to do is get a URL to your file (this can be anywhere--the app bundle, the documents directory, the internet, etc.), and have UIWebView load it with -loadRequest
Upvotes: 1