Javascript in a PDF?

跟風遠走 提交于 2019-12-31 03:35:25

问题


I made up an editable PDF for students to request transcripts. Now, I want to constrain the input. For example, I want only numbers for their ID number, and I want only letters (no special characters) in the name fields, etc. In addition, there's an input called "Year Last Attended" where they enter the last academic year the user attended the university. If the value entered is within 5 years of the current date, then the user should alerted that he/she can request a transcript through another website.

Can JS do this? If so, how would you do this? I just need examples for the things I've listed above, and I can work from there. If not, how would I do this in a PDF (Acrobat Pro)?

Anyone have suggestions for tutorials in Javascript specifically for PDF?


回答1:


Yes, the Adobe Acrobat Reader supports hosting JavaScript for uses such as field validation.

Here's some reference material:

http://www.adobe.com/devnet/acrobat/javascript.html

and some tutorials:

http://www.evermap.com/javascript.asp

http://www.pdfscripting.com/

AFAIK, you will need the full (Pro) version of Acrobat to write the scripts.



来源:https://stackoverflow.com/questions/1733358/javascript-in-a-pdf

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