Solved

I want to have self modifying javascript

Posted on 2004-09-20
2
361 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Can Be Caused By Disabled Services I have encountered a problem viewing PDF files using Adobe Acrobat Reader.  For the longest time, PDFs might launch or might not.  Sometimes they took about 15 minutes to appear after launching them. After som…
Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

785 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