如何将JavaScript代码放入PDF文档? [英] How can I put JavaScript code into a PDF document?

查看:119
本文介绍了如何将JavaScript代码放入PDF文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将JavaScript代码插入PDF文件?

How do I insert JavaScript code into a PDF file?

我可以编写JavaScript代码,我只想知道如何将其放入文件中,例如,显示当前日期,使用组合框等。

I can code JavaScript, I just wish to know how to put it into a file to, for example, display the current date, use a combobox, etc.

推荐答案

JavaScript通常与PDF文档中的对象相关联。例如,如果您希望用户能够通过单击打印按钮来打印PDF,请按照以下步骤操作:

JavaScript is typically tied to objects in a PDF document. For example, if you want the user to be able to print the PDF by clicking a Print button, follow the steps below:


  • 添加表单按钮(在高级编辑下完成)

  • 右键单击按钮并转到属性

  • 单击操作选项卡

  • 下选择操作:选择运行JavaScript

  • 在代码窗口中输入 print();

  • Add a button to the form (done under advanced editing)
  • Right click on the button and go to properties
  • Click the actions tab
  • Under Select Action: choose Run a JavaScript
  • put print(); in the code window

这是一个链接旧的(Acrobat 7.0.5) Acrobat JavaScript脚本
参考
让你开始了。

Here's a link to an old (Acrobat 7.0.5) Acrobat JavaScript Scripting Reference to get you started.

这篇关于如何将JavaScript代码放入PDF文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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