Solved

I want to have self modifying javascript

Posted on 2004-09-20
2
363 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe A recent question here at Experts Exchange piqued my interest, so I decided to provide a thorough solution and publ…
*Adobe Acrobat 9 was used for this article. Particular steps may vary depending on software versions. 1. Create a framework of your form in Word, leaving space where you’d ultimately like the Adobe fields to appear.  (Note: I use the blank lines …
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

739 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