These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Acting on Doc.open and doc.close events in doc level javascript

adoacr
Registered: May 4 2011
Posts: 41
Answered

Hi,
 
I read up on how to add doc level javascripts using acrobat and adding specific javascript for specifc actions. but I need to add the same javascript to a batch of files. Right now, Im planning to do this with itext. how do I write the code for the document open and close events in javascript (i.e without using acrobat) that I can just add to a batch of documents? also, I want to disable the save as dialog box that appears when the user closes the pdf(since the pdf contains a form which i dont need the user to save anyway). Will disabling this also prevent saving of any global environement variables set?

Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Accepted Answer
adoacr wrote:
also, I want to disable the save as dialog box that appears when the user closes the pdf(since the pdf contains a form which i dont need the user to save anyway)
Hi,

you just have to reset the "dirty flag", so Reader (or Acrobat) considers the PDF as untouched and close it without asking about saving :

this.dirty = false;

:-)