【原】UIWebView加载本地pdf、doc等文件

//加载本地pdf到webview

- (void) loadDocument:(NSString *)docName
{
    NSString *path = [[NSBundle mainBundle] pathForResource:docName ofType:nil];
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self loadRequest:request];
}

   

你可能感兴趣的:(UIWebView)