Al B
Al B

Reputation: 61

Open PowerPoint in Iphone/Ipad and display it in my application

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

Answers (3)

nilam_mande
nilam_mande

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-

https://developer.apple.com/library/ios/samplecode/DocInteraction/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010052-Intro-DontLinkElementID_2

Upvotes: 1

texmex5
texmex5

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

strange quark
strange quark

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

Related Questions