Google Answers Logo
View Question
Q: Does javascript work in pdf files? ( Answered 5 out of 5 stars,   0 Comments )
Subject: Does javascript work in pdf files?
Category: Computers > Programming
Asked by: codehead1953-ga
List Price: $5.00
Posted: 06 Oct 2004 15:05 PDT
Expires: 05 Nov 2004 14:05 PST
Question ID: 411258
I have an ebook that was compiled in the Windows based "exe." format.
In this ebook, I use JavaScript to display randomly selected banners
and to track usage.

What I am interested in knowing, is whether I can get the same
functionality if I use a "pdf" format instead of the "exe" format. In
other words, do pdf file support JavaScript?
Subject: Re: Does javascript work in pdf files?
Answered By: andyt-ga on 06 Oct 2004 15:24 PDT
Rated:5 out of 5 stars
Hi codehead1953,
Yes, JavaScript is supported in Adobe PDF documents.  From the Adobe
SDK information page on PDF documents located at

"JavaScript support
One of the easiest and most powerful ways to customize PDF files is by
using JavaScript. Based on JavaScript version 1.5 of ISO-16262
(formerly known as ECMAScript), JavaScript in Acrobat implements
objects, methods, and properties that enable you to manipulate PDF
files, produce database-driven PDF files, modify the appearance of PDF
files, and much more. You can tie Acrobat JavaScript code to a
specific PDF document, a page, field, or button within that document,
or a field or button within the PDF file, and even to a user action.

JavaScript is particularly useful for PDF/XML forms. JavaScript
enables automated forms handling, Web and database communication,
commenting, and user-interface capabilities. PDF files created with
Acrobat and Adobe server products allow data to be extracted as XML
into custom schemas. Applications written in Java & other languages
easily integrate Acrobat with Web Services using Simple Object Access
Protocol (SOAP)."

There are several JavaScript scripting references and guides available
from Adobe at

Acrobat 6:
Acrobat JavaScript Scripting Reference
04/2004 (PDF: 2.28 MB / 416 pages)

Acrobat JavaScript Scripting Guide
05/2003 (PDF: 1.06 MB / 90 pages)
(links to test debuggers available from the index page mentioned above)

Programming Acrobat JavaScript Using Visual Basic
05/2003 (PDF: 180 KB / 14 pages)

Multimedia JavaScript Reference
04/2004 (PDF: 776 KB / 125 pages)

Acrobat 5:
Acrobat JavaScript Object Specification
(PDF: 1.79 MB / 298 pages)

Search Strategy:
pdf reference, clicking on first link to "Adobe Solutions Network |
Adobe PDF - Specifications" and then clicking on the heading

If you have any questions, please post a clarification request before
closing/rating my answer and I'll be happy to reply.

codehead1953-ga rated this answer:5 out of 5 stars
Great answer. Saved me a lot of time. Thanks.

There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy