用javascript填写PDF表单 [英] Fill PDF form with javascript

查看:515
本文介绍了用javascript填写PDF表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是我所拥有的:

  • 用户填写很长的html表单
  • 用户获得下载不同pdf的链接(这是可填写的表格),链接是使用javascript生成的
  • 用户单击链接,生成url(使用用户之前提交的数据),在表单中处理数据,并填写字段*这是使用表单内的javascript完成的.​​
  • 用户在完成字段后返回pdf.

我正在运行的问题是,在某些情况下,当IE仅允许url中的2083个字符时,发送到表单所需的数据约为8000个字符.

The problem I'm running is that in some cases the data needed to send to the form is around 8000 characters, when IE only allows 2083 character in the url.

根据客户端的要求,我们需要在客户端进行所有操作,这意味着无法访问php,c#,java.另外,我正在使用Acrobat Pro X来处理pdf.

As requested by client, we need to do everything client side, that means no access to php, c#, java. Also I'm using Acrobat Pro X, to work with the pdfs.

是否可以提交帖子请求,以pdf格式处理该请求,填写表格并将填写好的表格退还给用户?还有另一种方法可以绕过IE的2083个字符限制吗?

Is there a way to submit a post request, process that request in the pdf, fill the form and return the filled form to the user? Is there another way to go around the 2083 character limit of IE?

推荐答案

如果要在客户端填写表单,为什么需要向服务器发送8000个字符的数据?似乎您需要做的就是在HTML页面中的JavaScript和PDF页面中的JavaScript之间建立通信.此处对此进行了说明: PDF hostContainer回调

Why do you need to send 8000 characters of data to the server if you want to fill out the form on the client side? Seems like all you need to do is to establish communication between the JavaScript in the HTML page and the JavaScript in the PDF. This is explained here: PDF hostContainer callback

PS:我是摘录自该书的作者: http://www.javabeat.net/2011/04/javascript-communication-between-html-and-pdf-in-itext/

PS: I'm the author of the book from which this excerpt was taken: http://www.javabeat.net/2011/04/javascript-communication-between-html-and-pdf-in-itext/

这篇关于用javascript填写PDF表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆