zoukankan      html  css  js  c++  java
  • doc文件UIWebView 直接展示

        NSString *path=[[NSBundle mainBundle]pathForResource:@"测试一" ofType:@"docx"];

        //获取内容

        NSData *data = [[NSData alloc]initWithContentsOfFile:path];

        NSString *string = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];

        NSLog(@"%@",string);

        

        UIWebView *webView = [[UIWebView alloc]initWithFrame:self.view.bounds];

        webView.delegate = self;

        webView.multipleTouchEnabled = YES;

        webView.scalesPageToFit = YES;

        

        NSURL *url = [NSURL fileURLWithPath:path];

        NSURLRequest *request = [NSURLRequest requestWithURL:url];

        [webView loadRequest:request];

        

        [self.view addSubview:webView];

    可以直接复制黏贴过去,改变文件名称即可,其他的没试过,就是一种doc,docx,都好使。

  • 相关阅读:
    文件搜索和图像裁剪
    Mat的复制
    map
    substr
    cin,scanf
    strstr
    Applying vector median filter on RGB image based on matlab
    sobel算子的一些细节
    matlab 有趣小细节
    高斯混合模型(GMM)
  • 原文地址:https://www.cnblogs.com/fanwenzheIOS/p/5437283.html
Copyright © 2011-2022 走看看