下载的可填写 PDF 表单可以通过 JavaScript 将数据提交到服务器吗?
虽然不使用 PDF 会很好,但我们正在使用仅生成 PDF 表单的遗留系统。
我正在使用一些嵌入 JavaScript 的 PDF 表单来将数据提交回服务器。该表单在浏览器中查看和填写时有效。
不幸的是,我们的用户喜欢将表单下载到他们的计算机上,完整填写,然后才从 Acrobat Reader 中收到错误消息,指出除非在浏览器中加载表单,否则无法提交表单。
如何使 JavaScript 表单提交在 Web 浏览器之外工作,阻止用户下载表单,或者让表单在他们填写之前警告他们它将无法工作?
Although it would be nice to not use PDF, we are using a legacy system that only generates PDF forms.
I am working with some PDF forms that embed JavaScript to submit data back to a server. The form works when viewed and filled out in the browser.
Unfortunately, our users like to download the forms to their computer, fill them out completely, and only then get an error from Acrobat Reader that it cannot submit the form unless it is loaded in a browser.
How can I make the JavaScript form submission work outside of the web browser, prevent the users from downloading the form, or have the form warn them it won't work before they fill it out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对 PDF 的了解可能至少是 Acrobat 的一个版本落后于曲线,但我认为对你的问题的简短回答是“你不能”。
从更大的角度来看:使用 PDF 作为数据输入用户界面是一条充满痛苦的道路。
如果您的目标是通过网络提供完美的 UI,请查看 Blueprint CSS 等解决方案。
如果您的目标是提供“丰富”的用户体验,请查看 JQuery。
如果您的目标是节省将现有文档复制为 Web 表单的工作,那么您还没有了解到使用 PDF 作为数据输入机制需要做多少实际工作。
My knowledge of PDF is probably at least one version of Acrobat behind the curve, but I think the short answer to your question is "You can't".
From a bigger picture point of view: the use of PDF as a data entry user interface is a path of much pain and suffering.
If your objective is to provide a picture-perfect UI available over the web, look at solutions like Blueprint CSS.
If your objective is to provide a 'rich' user experience, look at JQuery.
If your objective is to save yourself the work of replicating an existing document as a web form, then you have not yet learned how much real work it takes to use PDF as a data-entry mechanism.