// variable to store whether document has been opened already or not
var bAlreadyOpened;

function docOpened()
{

	if(bAlreadyOpened != "true")
	{
		// document has just been opened
		var d = new Date();
		var sDate = util.printd("mm/dd/yyyy", d);

                // set date now
                app.alert("About to insert date into field now");
		this.getField("todaysDate").value = sDate;

		// now set bAlreadyOpened to true so it doesn’t
		// run again
bAlreadyOpened = "true";
	}
	else
	{
		// document has already been opened
	}
}

// call the docOpened() function
docOpened();

ppjslc_commonex_3.pdf
0.08MB

출처 : Example Acrobat JavaScripts – Planet PDF

+ Recent posts