Solved

I want to have self modifying javascript

Posted on 2004-09-20
2
362 Views
Last Modified: 2008-03-06
I am looking through the whole Acrobat Scripting Reference, and I am trying to find a way to modify the javascript on the fly. I am not extremely familiar with PDF Javascript so I may just be missing something. I am looking for a way to overrite existing javascript code. I have a couple of ways in my head but they all have problems. The first way seems the most basic. I would create the new javascript and add it to the doc. Once complete I would delete the old javascript. The problem is I don't see any methods or attributes atleast in the Doc that will allow me to delete the old code. Any ideas how I can go about this?
0
Comment
Question by:jj819430
2 Comments
 
LVL 7

Author Comment

by:jj819430
ID: 12100263
I want this to all be done by Javascript within the document.
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 12100369
You don't have access to document level JavaScript from within JavaScript. You can however execute any JavaScript that you create in your script with the app.eval() method. So, if you don't have to store the JavaScript as actual JavaScript code, but can get away with storing it e.g. as the string content of a hidden form field you can execute it at runtime.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question