gpt4 book ai didi

javascript - 尝试提交带有签名图像的 PDF 表单

转载 作者:行者123 更新时间:2023-12-02 09:02:47 26 4
gpt4 key购买 nike

我正在尝试在 Firefox 浏览器中使用 adobe 插件在 pdf 表单中添加签名。我的代码无法与 Adob​​e Reader 配合使用并显示此错误“NotAllowedError:安全设置阻止访问此属性或方法。”

function addSignature(image){
try {
app.alert("add image");
this.createDataObject({cName: "my_signature", cValue: image});
oFile = util.streamFromString( image, "utf-8");
this.setDataObjectContents("my_signature", oFile);
this.submitForm({
cURL: VIS_SIGN_SERVER_URL , // + "#FDF",
cSubmitAs: "PDF" // the default, not needed here
});
} catch (e) {
app.alert(e);
}
}

但是当我安装了 Adob​​e Pro 后,它就可以正常工作了。即使我阅读了文档并搜索了这个问题,我也无法找到使其在 Adob​​e Reader 中运行的解决方案,也找不到任何表明无法在 Adob​​e Reader 中实现而只能在 Adob​​e Pro 中实现的文档。

预先感谢您!

最佳答案

根据 Adob​​e® Acrobat® DC SDK 中的 JavaScript™ for Acrobat® API 引用:

createDataObject |5.0|D||D|

setDataObjectContents |7.0|||D|

其中第四列中的 D 定义为:

The property or method is allowed in Acrobat Pro and Acrobat Standard. It can be accessed in Adobe Reader (version 5.1 or later) depending on additional usage rights that have been applied to the document:

...

● D — Requires file attachment rights

因此,您显然必须为您的 PDF 启用 Adob​​e-Reader(应用使用权限)才能使其在 Adob​​e Reader 中运行。

关于javascript - 尝试提交带有签名图像的 PDF 表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60040814/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com