【问题标题】:Unable to view digitally signed pdf file using pdf.js in angularjs无法在angularjs中使用pdf.js查看数字签名的pdf文件
【发布时间】:2021-10-02 06:53:31
【问题描述】:

我有一个使用 angularjs 1.x 和 codeigniter 3.x 的应用程序。在 chrome 和 firefox 中运行这个 webapp,并且能够查看普通的 pdf,但不能查看数字签名的 pdf 文件。请找到我正在使用的以下代码。 html端

<a ng-click="openViewer()" style="cursor:pointer;">Digitally_signed.pdf</a>

角度js侧

$scope.finalurl = btoa(BASE_URL+'/pdf_files/Digitally_signed.pdf');
$scope.openViewer = function() {
    var url = BASE_URL + '/web/pdfviewer.html?file=' + $scope.finalurl;
    window.open(url, 'newwindow', config = 'height=700, width=1000, ' +
        'toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, ' +
        'directories=no, status=no');
}

我关注了这个link,但没有成功。我还附加了一个输出作为我得到的图像。

您能否帮我在 pdfjs 库中进行哪些代码修改以查看数字签名的 pdf 文件。提前致谢。

【问题讨论】:

    标签: javascript angularjs codeigniter codeigniter-3 pdfjs


    【解决方案1】:

    在 Github 上,Issue #1076 声明 PDF.js 的开发人员无意实现打开数字签名 pdf 文件的可能性。

    您可以通过参与来贡献和推送此功能请求,以便获得更多关注。

    【讨论】:

    • @KJ 是的,可以使用 adobe 阅读器打开,但使用 pdfjs 只为最终用户提供自定义视图,例如不允许复制/打印/右键单击等
    • @KJ 实际上 pdfjs 从一开始就在应用程序中使用,现在我们得到了第一次数字签名的 pdf,因此现在不需要验证虚假签名,只需查看 pdf
    • @CalligraphVoid 让我看看你分享的话题
    • 我刚刚采用了新版本的 pdfjs,但是在使用上面的代码运行时,它说 Missing Pdf 异常。貌似不支持 btoa 转换。修改什么以使用 btoa 运行
    • 我也收到警告:不支持过滤器“Crypt”。
    猜你喜欢
    • 2012-10-31
    • 1970-01-01
    • 1970-01-01
    • 2019-08-09
    • 1970-01-01
    • 1970-01-01
    • 2015-04-12
    • 2019-11-06
    • 2014-11-07
    相关资源
    最近更新 更多