Skip to main content
Participant
December 20, 2017
Answered

Dynamic stamp data entry

  • December 20, 2017
  • 2 replies
  • 2331 views

I've created a dynamic stamp that has two fields for the user to enter data.

The stamp and javascript code seem to be working correctly except that I

get prompted twice for the data entry, once when selecting the stamp and

again when placing the stamp. I found a work-around; if I enter the data on

the first prompt and then 'cancel' on the second prompt the stamp gets placed

and the data shows correctly. This is the code I'm using for one of the fields:

var cResponse = app.response({

cQuestion: "Enter the Dates to appear in the stamp.",

cTitle: "Dates",

cLabel: "Dates"

event.value = cResponse;

I'm using the code from some examples I found. The other thing that would

be nice is to combine the two field prompts into one prompt for the data entry.

Regards,

Mike

This topic has been closed for replies.
Correct answer Thom Parker

You're missing a gating if for only running the code when it's being placed. If you don't have this code you'll get the prompts every time any stamp is selected.

You'll find everything you need to know about stamps here:

PDF Stamp Annotations

Here's an early article on creating advance dynamic stamps. It also includes the gating code you need, which relies on the stamp name, which is explained in the article:

https://acrobatusers.com/tutorials/dynamic_stamp_secrets

For combining the response dialogs you need to use a dialog. Here is a dialog creation tool for Acrobat JavaScript:

ACRODIALOGS OVERVIEW

2 replies

DimitriM
Inspiring
December 20, 2017

Hi Mike,

In order to have multiple input fields (or check boxes, pulldowns, radio buttons, etc) entered at once in a custom dynamic stamp you need to use a custom dialog.  Coding a custom dialog is an advanced task but there is an online dialog designer that makes the job much easier than hand coding- ACRODIALOGS OVERVIEW

There are examples of custom dialogs used with stamps in the video PDF Stamps Gone Wild so you can see how they work.  That video can be found at-

PDF Stamp Annotations

Hope this helps,

Dimitri

Participant
December 21, 2017

Thank you Dimitri.

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
December 20, 2017

You're missing a gating if for only running the code when it's being placed. If you don't have this code you'll get the prompts every time any stamp is selected.

You'll find everything you need to know about stamps here:

PDF Stamp Annotations

Here's an early article on creating advance dynamic stamps. It also includes the gating code you need, which relies on the stamp name, which is explained in the article:

https://acrobatusers.com/tutorials/dynamic_stamp_secrets

For combining the response dialogs you need to use a dialog. Here is a dialog creation tool for Acrobat JavaScript:

ACRODIALOGS OVERVIEW

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
December 21, 2017

Thank you Thom.