Skip to main content
This topic is closed to new replies. Start a new post to keep the conversation going.

12 replies

JR Boulay
Community Expert
Community Expert
Jun 28, 2020 10:04 AM UTC

You don't need to reinvent the wheel, search for "File Name Stamper" on this page: https://acrobatusers.com/actions-exchange/

Translate
Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
Jun 28, 2020 10:10 AM UTC

The problem (or feature, depending on how you look at it, I guess) with this Action is that it's a stamper, ie the name it adds is static. If you rename the file after running it it will still show the old file-name. That might be desired in some cases, but not in others. If you want it to be dynamic and always show the current file-name then it needs to be done using a field that is updated whenever the file is opened, as described above.

Translate
Participating Frequently
Jun 29, 2020 9:34 AM UTC

Thanks for the Note with the automatic update. I have an empty document and would like to display only the document name here, for example.

How to proceed then?

First I create a text field and give it a name, e.g. "DK_01".

Where do I enter the script so that it is updated when I open it?

Translate
Inspiring
Jun 28, 2020 4:40 AM UTC

You can use JavaScript to access the documentFileName property. Here's some sample code that sets a text field value to the document file name:

 

getField("Text1").value = documentFileName;

 

But the correct code depends on when you want the code to set the field value and where the code is placed. If you provide more information about your workflow, we could probably provide more help.

Translate
try67
Community Expert
Community Expert
Jun 28, 2020 9:45 AM UTC

If you use the code above place it as a doc-level script, so that it will update each time you open the file.

Translate
Participant
Mar 14, 2022 7:29 PM UTC

Can someone explain this more?  I don't understand where or what I'm supposed to do?

Translate