Adobe Acrobat Pro XI-将Javascript添加到PDF [英] Adobe Acrobat Pro XI - Adding Javascript to a PDF

查看:580
本文介绍了Adobe Acrobat Pro XI-将Javascript添加到PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是一个真正的新手问题,但是我整天都在扯头发.

This may seem like a really novice question, but I have been tearing my hair out all day on this.

我正在运行Adobe Acrobat Professional XI的试用版. 我希望将简单的JavaScript添加到PDF文件中.

I am running the trial version of Adobe Acrobat Professional XI I am looking to add simple JavaScript to a PDF file.

目的是要创建一个PDF文件,当打开该文件时,会弹出带有是"和否"选项的警告消息. 单击是",警报消失,保留要读取的PDF. 单击否",文件关闭.

The aim is to have a PDF file, that when opened, pops up with an alert message with Yes and No options. Click Yes, and the alert goes away, leaving the PDF to be read. Click No, and the file closes.

我遇到的主要麻烦是在哪里编写代码. 我使用过JavaScript调试器,但是它不是很直观,并且似乎不让我将JavaScript添加到文件中,只能在调试器中运行.

The main trouble I am having is where to write my code. I have used the JavaScript Debugger but it is not very intuitive, and doesn't seem to let me add JavaScript to the file, only run from within the debugger.

我在网上看到的所有教程都向我显示了代码,但没有显示代码的地方.

All the tutorials I have looked at online show me the code, but not where to write it.

推荐答案

在Adobe Acrobat中,打开右侧的工具"窗格,选择"JavaScript"部分,然后选择文档JavaScript".
输入脚本名称,然后单击添加.在JavaScript编辑器中,删除生成的代码并添加您的代码:

In Adobe Acrobat open Tools pane on the right, select JavaScript section and then Document JavaScripts.
Enter a script name and click Add. In the JavaScript editor remove the generated code and add yours:

app.alert({cMsg: "JavaScript action: hello", cTitle: "demo title"});

此代码(如果未放置在函数中)将在打开文档时自动执行.

This code (if not placed in a function) will be executed automatically when the document is opened.

这篇关于Adobe Acrobat Pro XI-将Javascript添加到PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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