I am novice Java Programmer. We wrote following code and put it under
C:\Program Files\Adobe\Acrobat 7.0\Acrobat\Javascripts.
I can open pdf and from menu click on “Print with Footer” and it print documents with footer.
But if I do not open and select the pdf file from window explorer and do the right click then it prints without footer. How can I print document with footer without opening and using following code
app.addMenuItem({cName:"Print with Footer", cParent:"File", nPos:20, cExec:"PrtFooter();"});
//Print bookmarked Pages
function PrtFooter()
{
for (var p = 0; p < this.numPages; p++)
{
var fd = this.addField("Date", "text", p, [10,10, 400,28]);
fd.textSize=8; fd.value = "Dt: " + util.printd("yyyy/mm/dd", new Date()) + " (" + this.path +")"
}
app.execMenuItem("Print");
{
for (var p = 0; p < this.numPages; p++)
{
} }
}
You also don't need to use the print menu item. I'd suggest using the menu item to only modify the document. Then use the regular print mechanisms to print the form.
You need to change your code so that the date is set with the "WillPrint" action. Also make the date field ReadOnly.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script