如何使用Javascript以PDF格式提交表单? [英] How can i submit a form in PDF by using Javascript?
问题描述
是否可以使用Javascript在PDF上引用表单或按钮?
我想要做的是编写将提交表单的Javascript代码,如果不是,请单击我提交表单的按钮。
Is it possible to reference a Form or a Button on a PDF using Javascript? What I am trying to do is to write Javascript code that will submit a form, or if not that, click a Button of my choice that submits the form.
我在这里遇到的问题是我不知道如何在Javascript中引用按钮或表单。
The problem I have here is that I don't know how to reference the button or the form in Javascript.
那么有没有办法实现这个目标?
So is there a way to achieve this?
推荐答案
在Acrobat JavaScript中,您无法执行单击按钮作为操作。
In Acrobat JavaScript, you can not execute "click a button" as an action.
而是执行该按钮的MouseUp事件分配的任何内容。如果它是一个函数,执行该函数,如果它是一些JavaScript代码行,则执行这些行。
Instead you execute whatever the MouseUp event of that button has assigned. If it is a function, execute the function, if it is some lines of JavaScript code, execute those lines.
在任何情况下,您都需要一个触发事件。当你指定它时,其余部分都很简单。
In any case, you will need a trigger event. When you have specified it, the rest is straightforward.
我还强烈建议您仔细查看Acrobat JavaScript文档。
I also strongly recommend to have a good look at the Acrobat JavaScript documentation.
这篇关于如何使用Javascript以PDF格式提交表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!