Latest 1.0.2
Homepage https://github.com/WeinanHu/WNDocWebViewController
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

WNDocWebViewController

这是一个使用WKWebView读取doc、docx文档的控制器,需要作为子控制器使用。

可以pod install

platform :ios, '8.0'

target 'testpoddoc' do

    pod 'WNDocWebViewController'

end

代码使用方式

    NSString *path = [[NSBundle mainBundle]pathForResource:@"test5.docx" ofType:nil];

    WNDocWebViewController *vc = [[WNDocWebViewController alloc]initWithDocUrl:[NSURL fileURLWithPath:path] viewFrame:CGRectMake(0, 20, self.view.bounds.size.width, self.view.bounds.size.height-20)];
    [self addChildViewController:vc];
    vc.defaultSizePercent = 2.5;
    [self.view addSubview:vc.view];

特点

  1. 可以通过手指粘合调整字体大小

  2. 去除doc、docx文档上下左右的空白

  3. 可以自定义文档字体颜色

  4. 可以自定义文档背景

  5. 记录并自动恢复上次已调整的字体大小

效果图

image


Latest podspec

{
    "name": "WNDocWebViewController",
    "version": "1.0.2",
    "summary": "it's a controller to open a resizable document(ep. .doc or .docx)",
    "description": "1. You can pinch the screen to resizable document(ep. .doc or .docx).n2. You can change the text color or background color of your document.n3. Auto save the font.",
    "homepage": "https://github.com/WeinanHu/WNDocWebViewController",
    "license": "MIT",
    "authors": {
        "WeinanHu": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/WeinanHu/WNDocWebViewController.git",
        "tag": "1.0.2"
    },
    "source_files": [
        "testdoc/WNDocWebViewController",
        "*.{h,m}"
    ],
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This