简体   繁体   English

如何使用 Javascript 提交 PDF 格式的表单?

[英]How can i submit a form in PDF by using Javascript?

Is it possible to reference a Form or a Button on a PDF using Javascript?是否可以使用 Javascript 引用 PDF 上的表单或按钮? 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.我在这里遇到的问题是我不知道如何在 Javascript 中引用按钮或表单。

So is there a way to achieve this?那么有没有办法实现这一目标?

In Acrobat JavaScript, you can not execute "click a button" as an action.在 Acrobat JavaScript 中,您不能将“单击按钮”作为操作执行。

Instead you execute whatever the MouseUp event of that button has assigned.相反,您执行该按钮已分配的任何 MouseUp 事件。 If it is a function, execute the function, if it is some lines of JavaScript code, execute those lines.如果是函数,就执行函数,如果是一些 JavaScript 代码,就执行那些行。

In any case, you will need a trigger event.在任何情况下,您都需要触发事件。 When you have specified it, the rest is straightforward.当您指定它时,剩下的就很简单了。

I also strongly recommend to have a good look at the Acrobat JavaScript documentation.我还强烈建议您仔细阅读 Acrobat JavaScript 文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM