当前位置:  开发笔记 > 编程语言 > 正文

UIWebView, Word office document and pagination

如何解决《UIWebView,Wordofficedocumentandpagination》经验,为你挑选了0个好方法。

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];

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

推荐阅读
雯颜哥_135
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有