这是我的第一个问题,所以请善待我。
最近,我们在可填充PDF表单方面遇到了问题。从本质上说,如果数据被输入,然后保存在Macintosh上,数据就会完全消失(您可以在这里读到更多关于这个:https://forums.adobe.com/message/3951187)。
我准备了下面的脚本来自动化这个过程(这要感谢JoelGeraci。您可以查看他的GitHub页面以获得更多信息@ https://gist.github.com/JoelGeraci/05e15f3792b299b68be900ab4489e959),但当我在adobe中运行时,它并不会循环到每个字段。关于我怎么解决这个有什么建议吗?
代码:
/*Code to fix broken PDF Forms*/
//Check version
if (app.viewerType != "Reader" || app.viewerVersion >= 11) {
app.addMenuItem({
//Add new menu item under the "Edit" tab
cName: "PPDF_fixFields",
cUser: 'Fix Field Appearances',
cParent: 'Edit',
//Run the function "fixFields()"
cExec: "fixFields()",
//Enable this option if the number of fields is greater than 0
cEnable: "event.rc = (this.numFields > 0);"
});
function fixFields() {
//Number of Fields
nFields = this.numFields;
//shows the progress bar
var t = app.thermometer;
t.duration = nFields;
t.begin();
//Cycle through all fields
for (var i = 0; i < nFields; i++) {
//nth Field
var f = this.getField(this.getNthFieldName(i));
//toggle delay to refresh content
f.delay = true;
f.delay = false
//progress bar
t.value = i;
}
//End progress bar
t.end();
//Producer info
if (app.viewerType != "Reader") {
this.info.Producer = "Adobe Acrobat " + app.viewerVersion
}
}发布于 2017-04-18 08:51:07
因此,您还注意到,对于PDF表单来说,Preview.app是绝对有害的。不幸的是,伤害不仅仅是不创造表象,而且任何形式中的逻辑都会被破坏。
因此,将表单数据导出为FDF更安全,并将其导入表单的空白版本。导出/导入应在Reader XI及更新版本中提供。
https://stackoverflow.com/questions/43462147
复制相似问题