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

原文地址:https://www.cnblogs.com/jisa/p/10553847.html