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

Print footer

Japi
Registered: Jun 3 2008
Posts: 2
Answered

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++)
{

} }
}

My Product Information:
Reader 7.0.9, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You're code is actually modifying the PDF file to add the Print Date to the bottom of the form. Once the file is modifiyed the first time, as long as it is saved, it doesn't need to be changed again to perform the same action.

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