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

Dynamic Stamp - text field

New Here ,
Apr 04, 2018 Apr 04, 2018

Copy link to clipboard

Copied

I am in the process of creating a dynamic stamp with a text field that has a custom calculation script to use the document name.

This is the script that I found and am using:

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

It pulls the document name in fine but it displays it as 1234.pdf, is there a different script or more that I need to add to the current script that would pull in the document name but leave off the .pdf?

TOPICS
Acrobat SDK and JavaScript , Windows

Views

467

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 , Apr 04, 2018 Apr 04, 2018

It's a simple string manipulation:

event.value = event.source.source.documentFileName.replace(".pdf", "");

Likes

Translate

Translate
Community Expert ,
Apr 04, 2018 Apr 04, 2018

Copy link to clipboard

Copied

It's a simple string manipulation:

event.value = event.source.source.documentFileName.replace(".pdf", "");

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 ,
Apr 04, 2018 Apr 04, 2018

Copy link to clipboard

Copied

That worked beautifully!! Thank you for your quick response.

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 ,
May 20, 2021 May 20, 2021

Copy link to clipboard

Copied

LATEST

u

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