在 PDF 文件中使用 JavaScript 代码的文档 [英] Documentation for using JavaScript code inside a PDF file

查看:29
本文介绍了在 PDF 文件中使用 JavaScript 代码的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪里可以找到关于在 PDF 中运行 JavaScript 代码的文档?

我从未在 PDF 文档中添加过 JavaScript 操作.但是,我已经使用 JavaScript 进行了相当多的 Web 开发.我有几个问题要问任何熟悉 PDF 文档中的 JavaScript 的人.

NitroPDF 和 Adob​​e Acrobat 绝对支持 PDF 文件中的 JavaScript.是否存在有关通过 JavaScript 操作 PDF 文件的各种对象的标准?到目前为止,我发现的所有内容都来自 Adob​​e.其他任何地方似乎都参考了 Adob​​e 的文档.是否有标准,或者 Adob​​e 只是事实上的"标准?

此外,所有 PDF 查看器都支持 JavaScript 操作吗?

我能找到的关于在 PDF 文档中使用 JavaScript 的最佳文档来自 Adob​​e - Adobe :: Acrobat JavaScript 脚本指南.

NitroPDF 有这个链接 - NitroPDF :: JavaScript in PDF Files,但它基本上只是说它支持 Adob​​e 的功能.

我还找到了来自 Scribus 的链接 - Scribus :: 如何使用 JavaScript 增强您的 PDF 表单,但这仅包括一些小代码片段.没什么特别有用的.

Adobe 有关于如何使用他们的 IDE 为 JavaScript 设置断点等的文档.是否可以使用另一个 IDE 在 PDF 文件中运行 JavaScript 并具有断点等...?找到像 Firebug 这样酷的东西会很棒.

注意:

请不要回答如何操作在网络浏览器中加载的 PDF.问题是关于从 PDF 文档中运行 JavaScript.我正在尝试通过在 PDF 文档中执行 JavaScript 来探索可用的可能性.具体来说,我可能会使用 quickpdflibrary 中的函数将 JavaScript 功能添加到现有文档中.>

另一个有用的链接是使用 Acrobat JavaScript 开发.显然,PDF 中的 JavaScript 代码通常称为 AcroJS 或 Acrobat JavaScript.

解决方案

可能您正在寻找 JavaScript™ for Acrobat® API 参考.

这个参考应该是最全的.但是,正如@Orbling 所说,并非所有 PDF 查看器都可能支持所有 API.

事实证明,Acrobat SDK 中有更新版本的参考资料(感谢@jss).

Acrobat Developer Center 包含指向不同版本文档的链接.JavaScript 参考的当前版本 也可以从 Acrobat DC SDK 获得.

Where can I find documentation on running JavaScript code inside a PDF?

I've never added a JavaScript action inside a PDF document. However, I've done quite a bit of web development using JavaScript. I have a few questions to whoever has any familiarity with JavaScript inside a PDF document.

NitroPDF and Adobe Acrobat definitely support JavaScript in PDF files. Is there a standard on various objects that exist and functions to manipulate a PDF file via JavaScript? Everything I've found so far has been from Adobe. Anywhere else seems to reference Adobe's documentation. Is there a standard out there, or is Adobe just the "de Facto" standard?

Also, Do all PDF viewers support JavaScript actions?

The best documentation on using JavaScript inside a PDF document that I could find was from Adobe - Adobe :: Acrobat JavaScript Scripting Guide.

NitroPDF has this link - NitroPDF :: JavaScript in PDF Files, but it basically just says it supports what Adobe has.

I also found this link from Scribus - Scribus :: How to enhance your PDF forms with JavaScript, but this only includes a few small snippets of code. Nothing super useful.

Adobe has documentation on how you can set breakpoints, etc... for JavaScript using their IDE. Is it possible to run JavaScript in a PDF file using another IDE and have breakpoints, etc...? It would be awesome to find something as cool as Firebug.

Note:

Please do not answer how to manipulate a PDF that is loaded in a web browser. The question is about running JavaScript from within a PDF document. I'm trying to explore the possibilities available via executing JavaScript in the PDF document. Specifically I may use functions from quickpdflibrary to add JavaScript functionality to existing documents.

Another useful link is Developing with Acrobat JavaScript. Apparently JavaScript code in PDFs is frequently called AcroJS or Acrobat JavaScript.

解决方案

Probably you are looking for JavaScript™ for Acrobat® API Reference.

This reference should be the most complete. But, as @Orbling said, not all PDF viewers might support all of the API.

EDIT:

It turns out there are newer versions of the reference in Acrobat SDK (thanks to @jss).

Acrobat Developer Center contains links to different versions of documentation. Current version of JavaScript reference from Acrobat DC SDK is available there too.

这篇关于在 PDF 文件中使用 JavaScript 代码的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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