• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

File name to Dynamic Stamp

Community Beginner ,
Mar 18, 2021 Mar 18, 2021

Copy link to clipboard

Copied

Would anyone know how to stamp the file name using JavaScript to my dynamic stamp in Acrobat.

TOPICS
JavaScript

Views

2.0K

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 , Mar 18, 2021 Mar 18, 2021

From inside a stamp script the "this.documentFileName" will return the name of the stamp file, not the name of the file being stamped.

Use this code in a calculation script on the stamp to put the name of the file being stamped into the field.

 

event.value = event.source.source.documentFileName;

 

This is code is undocumented. You can read all about it here:

https://acrobatusers.com/tutorials/dynamic_stamp_secrets/

 

Find out everything you ever wanted to know about stamps here:

https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm

...

Votes

Translate

Translate
Community Expert ,
Mar 18, 2021 Mar 18, 2021

Copy link to clipboard

Copied

If I'm correct, you know how to create dynamic stamps? If not read here: https://helpx.adobe.com/acrobat/kb/create-custom-dynamicstamp.html

 

The JavaScript for getting a document's name is:

this.documentFileName

 

ABAMBO | Hard- and Software Engineer | Photographer

Votes

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 ,
Mar 18, 2021 Mar 18, 2021

Copy link to clipboard

Copied

LATEST

From inside a stamp script the "this.documentFileName" will return the name of the stamp file, not the name of the file being stamped.

Use this code in a calculation script on the stamp to put the name of the file being stamped into the field.

 

event.value = event.source.source.documentFileName;

 

This is code is undocumented. You can read all about it here:

https://acrobatusers.com/tutorials/dynamic_stamp_secrets/

 

Find out everything you ever wanted to know about stamps here:

https://www.pdfscripting.com/public/All_About_PDF_Stamps.cfm

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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