Skip to main content
Known Participant
November 3, 2020
Question

How to automatically show filename in Acrobat DC header

  • November 3, 2020
  • 3 replies
  • 5630 views

Hi,

 

I need to show the name of the file in the document header. I found a script for that purpose for the reader but for a professional product I think there should be a builtin way of grabbing the filename for the header as a default. Unfortunately I could not find the internal names of the properties. Can anyone help?

 

Thanks.

 

Susanne

This topic has been closed for replies.

3 replies

try67
Community Expert
Community Expert
November 3, 2020

You have to use a script to do it, but it's very simple. Create a (read-only) text field called "FileName" and add the following code under Tools - JavaScript - Document JavaScripts (NOT inside a function):

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

 

Of course, the file name also appears in the title of the application window (unless there's a title and it is set to show that instead), but you seem to want it to appear on the page itself, too...

Known Participant
November 3, 2020

Ok, I inserted that line, but how do I get hold of the info in the header?

try67
Community Expert
Community Expert
November 3, 2020

What "info in the header", exactly?

Legend
November 3, 2020

Do you actually have Acrobat (the paid for product)? Or do you just have Acrobat Reader (the free product?) 

Known Participant
November 3, 2020

Hm, I thought my statements where quite explicit:
"I found a script for that purpose for the reader but for a professional product ..."

try67
Community Expert
Community Expert
November 3, 2020

Do you mean that you think it works in Adobe Reader but not Adobe (Acrobat) Pro? Because if so, that's not the case.

Bernd Alheit
Community Expert
Community Expert
November 3, 2020

What script have you found?

Known Participant
November 3, 2020
Bernd Alheit
Community Expert
Community Expert
November 3, 2020

This script will work in Acrobat Reader and Adobe Acrobat.