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

Dynamic stamp dialogue not appearing

New Here ,
Jul 27, 2019 Jul 27, 2019

Copy link to clipboard

Copied

Acrobat DC Pro on Win 10 Pro.

I have created a dynamic stamp and called the file "Receipt.pdf". I want to use it to signify that my invoice has been paid by my client.

There are two text fields, one above the other, the first to show the current date and the second field I want to generate a dialogue for me to insert particulars of the payment, e.g., a cheque number or other identifier.

When I apply the stamp to the pdf invoice, the date field works fine, but no dialogue is generated. So the stamp appears with the current date and a blank space beneath it.

The "custom calculation script" for the date field is:

event.value = (new Date()).toString();

AFDate_FormatEx("dd mmm yyyy");

The script for the dialogue field is:

var cAsk = "Enter Receipt Details" ;

var cTitle = "Receipt Details" ;

if(event.source.forReal && (event.source.stampName == "#Receipt"))

{

  var cMsg = app.response(cAsk, cTitle);

  event.value = cMsg;

  event.source.source.info.exhibit = cMsg;

}

I am ignorant about javascript and have merely done my own research and followed other examples which seem to work. Would some kind person please help me to get that dialogue field working properly? Any advice will be much appreciated, but please keep it simple!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.1K

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 , Jul 27, 2019 Jul 27, 2019

The file name is not the stamp name.

Votes

Translate

Translate
Community Expert ,
Jul 27, 2019 Jul 27, 2019

Copy link to clipboard

Copied

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
New Here ,
Jul 27, 2019 Jul 27, 2019

Copy link to clipboard

Copied

Thanks for your reply.

I have deleted the stamp and re-created it to get an original file name, which is OG3txYF8ow2Bqq3sCWTXoD.pdf.

The script is now:

var cAsk = "Enter Receipt Details" ;

var cTitle = "Receipt Details" ;

if (event.source.forReal && (event.source.stampName == "OG3txYF8ow2Bqq3sCWTXoD"))

{

  var cMsg = app.response(cAsk, cTitle);

  event.value = cMsg;

  event.source.source.info.exhibit = cMsg;

}

However, the result is still the same as originally described.

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 ,
Jul 27, 2019 Jul 27, 2019

Copy link to clipboard

Copied

The file name is not the stamp name.

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
New Here ,
Jul 27, 2019 Jul 27, 2019

Copy link to clipboard

Copied

LATEST

Bernd, thanks for your very prompt replies.

I have to say that I found that "Secrets" article, which I had read many times before coming to this forum, to be very obscure and difficult to follow. Maybe it is clear to those who are familiar with javascript, but not to me. It does not make clear the distinctions between the file name in the "Stamps" folder and the file name given by the user in Acrobat on creation of the stamp and the stamp name. It could also make clear how you actually "run" the code to disclose the stamp name. I tried many ways to run the code and nothing happened. When I googled how to run it, and then actually ran it, everything became clear.

My problem is now solved. Many thanks, Bernd, for your help.

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