javascript 将 pdf 表单字段提交到 HTTP POST 请求
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4346590/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Submit pdf form fields to a HTTP POST request
提问by Josjojo
I've made a pdf form in Adobe Acrobat. Now I want to make a button that submits the form to a HTTP POST request. I have searched for about 4 hours, but I have not found an example to do this.
我已经在 Adobe Acrobat 中制作了一个 pdf 表单。现在我想制作一个按钮,将表单提交给 HTTP POST 请求。我已经搜索了大约 4 个小时,但我还没有找到一个例子来做到这一点。
Here I read that it is possible to send the pdf form fields with a HTTP submission, but there's also no example given: http://acrobatusers.com/tutorials/form-submit-e-mail-demystified
在这里,我读到可以通过 HTTP 提交发送 pdf 表单字段,但也没有给出示例:http: //acrobatusers.com/tutorials/form-submit-e-mail-demystified
I'm looking for a JavaScript example that I can link to the submit button.
我正在寻找一个可以链接到提交按钮的 JavaScript 示例。
回答by Mark Storer
doc.submitForm(url, false);
or
或者
doc.submitForm( url, null, null, null, null, null, null, null, null, null
null, null, null, null, null, "HTML" );
submitFormactually takes 23 different parameters, the above is only using 16 of them. And if I miscounted, I'm trying to use the cSubmitAs parameter.
submitForm实际上需要23个不同的参数,上面只使用了其中的16个。如果我算错了,我会尝试使用 cSubmitAs 参数。
This from the JavaScript API reference, which can be found at... lets see... right here. Enjoy.
这来自 JavaScript API 参考,可以在以下位置找到...让我们看看... 就在此处。享受。
PS: "this" is almost universally the document in acrobat events. event.target might be a field or something, but "this" is going to be the document.
PS:“this”几乎普遍是 acrobat 活动中的文件。event.target 可能是一个字段或其他东西,但“this”将是文档。
PPS: Things like bEmpty, aFields, and various other parameters don't work when bFDF = false.
PPS:喜欢的事情bEmpty,aFields以及其他各种参数不工作的时候bFDF = false。

