How to insert filepath in Acrobat footer

Community Beginner ,
Sep 29, 2021 Sep 29, 2021

Copy link to clipboard

Copied

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!

TOPICS
Create PDFs , Edit and convert PDFs , General troubleshooting , How to

Views

605

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 29, 2021 Sep 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 - Java

...

Likes

Translate

Translate
Community Expert ,
Sep 29, 2021 Sep 29, 2021

Copy link to clipboard

Copied

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;

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 29, 2021 Sep 29, 2021

Copy link to clipboard

Copied

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;

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 29, 2021 Sep 29, 2021

Copy link to clipboard

Copied

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

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 29, 2021 Sep 29, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 12, 2022 Aug 12, 2022

Copy link to clipboard

Copied

I'm no expert but have been using Adobe products for quite a while. And, one of the reasons i hesitated to make this switch to DC is things that i could do, i now cannot. This - default footer with file path - is a perfect example of what i set once as a preference, and forgot - and never had to worry about where a document was pulled from, or when in case it was outdated. Now, its a thing. Thanks, Adobe. No, not really.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2022 Aug 12, 2022

Copy link to clipboard

Copied

Not sure what you mean. This was never a feature of Acrobat.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

Acrobat Pro XI, yes.

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

LATEST

How have you created the PDF files?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines