1

I have a zip file. In that zip file I have some ppt presentation.

I want to show that ppt presentation in my UIWebView.

I cannot extract and show ppt files there directly .

How do I access the ppt inside the zip in objective c?

Robert
  • 37,670
  • 37
  • 171
  • 213
Jean-Luc Godard
  • 1,873
  • 3
  • 28
  • 53

1 Answers1

1

This isnt easy. You might want to consider doing this another way. For example you could put the file unzipped on a server and open the link in a webview.

However, if you really want to do it this way there is 2 step.

1. Unzip the file.

You want end up with NSData. Read though some of the links suggested in the comments. You will need to use a 3rd party library to achieve this.

2. Load the data in to a UIWebView.

Write the NSData to the temp directory then point the UIWebView at it.

NSString *path = // .. Get a location in the NSTemporaryDirectory
if ([pptData writeToFile:path atomically:YES]) 
{
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webview loadRequest:request]; 
}
Community
  • 1
  • 1
Robert
  • 37,670
  • 37
  • 171
  • 213