UIWebView, Word office document and pagination

Man*_*nny 7 iphone objective-c uiwebview ipad

When UIWebView loads Microsoft word documents, it just loads it as if it's one whole strip of paper, disregarding the separation between pages. Any idea how to display it properly (pages separated from each other), I'm open to lower level programming, or alternatives to UIWebView for loading Office documents. I'm currently using IPhone OS 3.2 for IPad.

E.g. I tried creating a word document with 2 pages, and one paragraph on each page, when I load it in UIWebView, it's displayed in one page.

The code I used is from 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];
}

// Calling -loadDocument:inView:
[self loadDocument:@"test1.doc" inView:self.myWebview];
Run Code Online (Sandbox Code Playgroud)

作为旁注,我认为这应该是可能的,因为有像Documents to Go和QuickOffice这样的应用程序,我不确定它们是如何实现的.

Man*_*nny 1

在当前的 SDK 中,这是不可能的。我们最终实现了自己的并使用 UIScrollView 来满足我们的要求。实现我们自己的渲染器、自己的平移系统等需要大量工作。