When UIWebView loads Microsoft text documents, it just loads it, as if it were one whole strip of paper, ignoring the separation between pages. Any idea how to display correctly (pages separated from each other), I am open for programming at the lower level or an alternative to UIWebView for loading Office documents. I am currently using IPhone OS 3.2 for the iPad.
eg. I tried to create a Word document with 2 pages and one paragraph on each page, when I load it into a UIWebView, it appears on one page.
The code I use is Apple Technical Q & A
-(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]; }
As a side note, I think it should be possible, because there are applications like Documents to Go and QuickOffice, I'm not sure how they implemented it.
objective-c iphone ipad uiwebview
Manny
source share