当前位置: 代码迷 >> Web前端 >> UIWebView打开doc、pdf资料
  详细解决方案

UIWebView打开doc、pdf资料

热度:471   发布时间:2012-08-25 10:06:20.0
UIWebView打开doc、pdf文件

UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 55, 320, 300)];
????webView.delegate = self;
????webView.multipleTouchEnabled = YES;
????webView.scalesPageToFit = YES;

????NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
????NSString *documentsDirectory = [paths objectAtIndex:0];
????NSString *docPath = [documentsDirectory stringByAppendingString:@"/doc2003_1.doc"];????NSLog(@"#######%@",docPath);
????
????NSURL *url = [NSURL fileURLWithPath:docPath];
????NSURLRequest *request = [NSURLRequest requestWithURL:url];
????[webView loadRequest:request];
????
????[self.view addSubview:webView];
????[webView release];

1 楼 sgjsdf5944 2012-02-23  
没看明白。。。。。。。。。。