首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Adobe Acrobat Pro DC JavaScript字段属性未传播

Adobe Acrobat Pro DC JavaScript字段属性未传播
EN

Stack Overflow用户
提问于 2016-12-21 00:31:19
回答 0查看 576关注 0票数 0

我在Adobe Acrobat Pro DC定制项目中被带了进来。这个项目的目标是在每个页面的左边缘添加一个警告。我得到了一段JavaScript,它可以做到这一点,但有一个异常,并要求我修复那个异常。

代码是:

代码语言:javascript
复制
var inch = 72; 
for (var p = 0; p < this.numPages; p++) { 
    var aRect = this.getPageBox( {nPage: p} ); 
    aRect[0] = 8.25*inch; //how far from the left the box ends
    aRect[1] = 0.5*inch; //how high from the bottom the box is
    aRect[2] = 7.75*inch; //how far from the left the box starts
    aRect[3] = 11.0*inch; //how tall the box is
    var f = this.addField("ControlledDoc", "text", p, aRect ) 
    f.rotation = 270;
    f.delay = true; 
    f.textSize = 7.5; 
    f.textFont = font.HelvB; 
    f.textColor = color.red; 
    f.alignment = "center"; 
    f.readonly = true; 
    f.display = display.visible; 
    f.delay = false; 
}
var myWillSaveScript = 'var f = this.getField("ControlledDoc"); \r' 
+ 'f.value = "This is an electronic controlled copy of a paper based document management system. When printed on the copy machine it becomes an uncontrolled paper copy valid until the end of the printing day."; \r';
this.setAction("WillSave", myWillSaveScript);

当文档的长度超过一页时,就会出现问题。ControlledDoc字段按预期在每个页面上复制。每页都有一个ControlledDoc#n-1字段,其中n是页码。在第一个页面上,f.rotation设置被保留,并在UI中显示为属性对话框中的方向下拉菜单设置为270。但是,在第二页和后续页面上,方向设置为0。我可以手动编辑文档并将方向设置为270,但这违背了使用JavaScript实现自动化的目的。

我是用JavaScript控制Acrobat Pro DC的新手,所以如果我错过了一些愚蠢的东西,我不会感到惊讶。

要使旋转设置在第二页和后续页面上保持不变,我需要进行哪些更改?

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41247013

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档