Ask a Question related to Adobe Acrobat Windows, Design and Development.
-
Gerry_Heinemann@adobeforums.com #1
Confused and Dazed
Been staring at this and don't know how to solve it.
Using:
Acrobat 5.05
Windows NT 4.0 SP6
P4 2.0 GHz
256 MB RAM
I'm trying to use the "Doc/Open" event to add the current date and an expiry date to the bottom of a document each time it's opened.
I can do it manually by going to the Tools - Javascript - Document Javascripts, adding a script name and adding the following code:
var numpage = this.numPages;
var now = new Date();
var days = 3;
/*
variable "days" is the number of days till expiry of the document
* / var date_num = now.valueOf();
date_num += 1000 * 60 * 60 * 24 * days;
var expire_date = new Date(date_num);
for (var i=0; i < numpage; i++) { var f = this.addField("Expiry", "text", i, [30,40,220,13]); f.userName="Date Opened and Date Expired"; f.display = display.noView; f.textsize = 10; f.borderStyle = border.s; f.alignment = "left"; f.multiline = true; f.value = ("Printed on: "+util.printd("yyyy-mm-dd",new Date())+" \nExpires on: "+ util.printd("yyyy-mm-dd", expire_date)); }
What I want to do is have a menu item added using:
app.addMenuItem({cName: "Expire", cUser: "Add Doc Expiry Date", cParent: "Document", nPos: 30, cExec: "Expiry();", cEnable: "event.rc = app.activeDocs.length > 0" });
and wrap the above code as the function ("Expiry()") so that the user can select the menu item "Add Doc Expiry Date" to add this code to the open document.
This does not add it to the document level but to the field "Exipry" and it's only run once.
This is where I'm stuck.
How do I get app.addMenuItem to add the above code to the Document Level javascript of the document currently open so it's run each time the document is opened.
Gerry
Gerry_Heinemann@adobeforums.com Guest
-
Confused with FCS And FMS
I am little confused with the terminology FCS And FMS, I cant see which are the differences. -
Confused....oh so confused.
Ok, I have this form: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head>... -
OT: :confused;
I have been seeing this all over the board, what the heck is it? Is it an emoticon? Thanks, Drew -
Confused....
I'm in the same scenario that Piers was in. My form looks sharp and I want to take the results of a completed form and post to my J2EE server via... -
Confused?
Hi Everyone, I'm having a bit of a problem and was wondering if anyone would be able to tell me what I'm doing wrong. the URL to the site I'm... -
Gerry_Heinemann@adobeforums.com #2
Re: Confused and Dazed
The just of the above question is how do I add a document level javascript, using the "Doc/Open" event as a trigger, to an open document using a Javascript?
Gerry
Gerry_Heinemann@adobeforums.com Guest



Reply With Quote

