Skip to main content
Participating Frequently
September 29, 2021
Answered

How to insert filepath in Acrobat footer

  • September 29, 2021
  • 1 reply
  • 7726 views

Is there any way to insert a footer in an Acrobat PDF that contains the filepath of the document? It's a standard feature on all MS Office software, and some of your competitors in PDF creation software inclue that feature. From what I've seen, Acrobat can only insert date, time, page number, and Bates numbering in a footer (or header). Without needing to know machine language, is there a way to insert a filepath in a footer? If not, could you please add it to the list of next generation requests? Thanks!

This topic has been closed for replies.
Correct answer try67

The issue is that a footer in Acrobat is not dynamic. So if you move the file to a different location, or rename it, it will no longer be accurate. If you want it to always show the right value then you must use a field, populated by a script each time the file is opened.

The code to do it is quite simple. Let's say you created a (read-only) text field called "Footer". You can duplicate the field to all pages once you've created it on the first one.

Then add the following code under Tools - JavaScript - Document JavaScripts to make sure it updates each time you open the file:

 

this.getField("Footer").value = this.documentFileName;

 

If you want it to show the full path use this:

 

this.getField("Footer").value = this.path;

1 reply

try67
try67Correct answer
Community Expert
September 29, 2021

The issue is that a footer in Acrobat is not dynamic. So if you move the file to a different location, or rename it, it will no longer be accurate. If you want it to always show the right value then you must use a field, populated by a script each time the file is opened.

The code to do it is quite simple. Let's say you created a (read-only) text field called "Footer". You can duplicate the field to all pages once you've created it on the first one.

Then add the following code under Tools - JavaScript - Document JavaScripts to make sure it updates each time you open the file:

 

this.getField("Footer").value = this.documentFileName;

 

If you want it to show the full path use this:

 

this.getField("Footer").value = this.path;

Participating Frequently
September 29, 2021

Hi try67 -

 

Thanks so much for the info. 

I tried it, but I needed to go into Prepare Forms to access the "Insert Text Field" function. At the end, I had created a filepath footer, but it also left me with several unwanted editable text fields in my document. All I wanted is to add the 1 field. Where did I go wrong?

Yes, a filepath field is dynamic - must be updateable if the doc is moved. But so are many header/footer fields - date of last edit, even document pages must be updated to account for insertions to the document. This is an easily available function in all MS Office apps. They seem to have solved this problem, and have created an "Add Fields" function, that doesn't require users to learn JavaScript and go through a multi-step procees in every doc.

Can you submit a request to Adobe to add this to the next update?

Thanks for your help!

Best,

Lorna

 

try67
Community Expert
September 29, 2021

You should have told it to not detect fields automatically, and just add it yourself.

If you want to access the document's last modification date you can do so like this:

 

this.modDate;

 

PDF files are very different from Word files. If you want to do anything dynamic with them you need to know JavaScript, that's just the way it is.