I want to have self modifying javascript

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?
LVL 7
jj819430Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Karl Heinz KremerConnect With a Mentor Commented:
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
 
jj819430Author Commented:
I want this to all be done by Javascript within the document.
0
All Courses

From novice to tech pro — start learning today.