Fill PDF form with javascript

我们两清 提交于 2019-12-21 19:47:51

问题


This is what I have:

  • User fills very long html form
  • User gets link to download different pdfs (this are fillable forms), links are generated using javascript
  • User clicks link, url is generated (with the data the user submitted before), data is processed in the form and fields are completed *this is done using javascript inside the form).
  • User get pdf back with fields completed.

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.

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.

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?


回答1:


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: 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/



来源:https://stackoverflow.com/questions/15218666/fill-pdf-form-with-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!