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

File Name in Footer

cmorton89
Registered: Jan 14 2008
Posts: 2

Is there a way to automatically have the file name appear on a PDF in the footer and update if the name of the document changes on save or open or print?

My Product Information:
Reader 8.0999999999999996447286321199499070644378662109375, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes. Place a text field on the bottom of the page and place this script in the calculate event.

AcroForm:

event.value = this.documentFileName;

LiveCycle

this.rawValue = event.target.documentFileName;

You could also put the code into a document script and/or the onSave event.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

dws
Registered: Feb 27 2008
Posts: 3
When I did this my"file name" came back encrypted. Is there a way to get the unencrypted "file name" to appear? example: my file name is "Customer Survey 123456.pdf" in the text field "_e4s162cp4c0575os.pdf" appears.

Well as it turns out once I saved the document in LiveCycle, closed it and opened it in reader the correct file name appeared.
DanielKunz
Registered: Jan 22 2008
Posts: 55
The returned filename in Livecycle Designer is not encrypted.
Livecycle Designer creates a new file with that name for testing.
Otherwise your original file will be overwirtten everytime you create an preview.
LeslieWx
Registered: Oct 14 2009
Posts: 1
thomp wrote:
Yes. Place a text field on the bottom of the page and place this script in the calculate event.AcroForm:
event.value = this.documentFileName;
LiveCycle
this.rawValue = event.target.documentFileName;

You could also put the code into a document script and/or the onSave event.
I'm in no way a power user; I've just got a couple dozen differently scanned versions of an archival document that I need printed and distinguishable copies of. I did the above in 2 different documents and it worked. Then I got tired of cutting & pasting the script into each Text Field's "calcuate event" window, and tried to copy/paste the text box itself. Problem: it looks fine on my screen, but the printed version shows the file name from which the text box was copied.How can a newbie to Acrobat programming get something set up that will allow her to quickly and simply add a dynamic file name field to a pdf for printing?

Am using Acrobat 8.1.0 Professional on a Mac OS X 10.5.8. Yeah, I know it's not the latest Acrobat, but I had to fight to get *anything* more powerful than Reader.