zoukankan      html  css  js  c++  java
  • iOS 不能加载电子签名

    问题:

    1:使用WKWebView在iOS12.0以上的系统中,可以显示PDF中的电子图章,签名。在iOS12.0以下的系统中不能显示电子签名,图章。

    2:  解决方案,使用PDF.js加载。 pdf.js是火狐浏览器的开源项目,地址为:  http://mozilla.github.io/pdf.js/

        问题。

      必须先将要加载的PDF下载到本地,在从本地加载。

      导入下载的pdf.js 必须使用 code fold reference

        将隐藏签名的代码注销

        data.readOnly = _this2.hasFieldFlag(_util.AnnotationFieldFlag.READONLY);
        if (data.fieldType === 'Sig') {
    //      _this2.setFlags(_util.AnnotationFlag.HIDDEN);
        }

     调用 只能使用UIWebView

        NSString *filePath = [[NSBundle mainBundle] pathForResource:@"PDF" ofType:@"pdf"];
        NSString *viwerPath = [[NSBundle mainBundle] pathForResource:@"viewer" ofType:@"html" inDirectory:@"pdfjs-2.0.943-dist/web"];
        NSString *urlStr = [NSString stringWithFormat:@"%@?file=%@#page=1",viwerPath,filePath];
        urlStr = [urlStr stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlStr]];
        
        UIWebView *web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 300, SCREEN_WIDTH, 300)];
        [web loadRequest:request];
        [self.view addSubview:web];

    pdf.js 的目录结构

        参考链接:https://blog.csdn.net/loving_ios/article/details/83023873

  • 相关阅读:
    省选模拟24 题解
    省选模拟23 题解
    省选模拟22 题解
    省选模拟21 题解
    省选模拟20 题解
    省选模拟19 题解
    省选模拟18 题解
    源码分析工具
    深入理解js的变量提升和函数提升
    python并发编程之IO模型
  • 原文地址:https://www.cnblogs.com/jisa/p/10553847.html
Copyright © 2011-2022 走看看