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
Braniac
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;

try67
Braniac
September 29, 2021

PS. It might also be a good idea to set the field default value, so that if the form is reset it will still show the text.

To do so add the following line after either one of the first two I provided:

 

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