Skip to main content
Michail Wod.
Participating Frequently
September 14, 2016
Question

Dynamic Stamp with Popup Selection and automatic addition of some Text depending on Selection

  • September 14, 2016
  • 6 replies
  • 645 views

hi folks,

i customized a dynamic stamp (template) for approving pdf documents. you can choose the approvers name from a popup menu and the stamp shows his name. it works fine, but i want to add another textfield which should contain the signature of the approver. i already built a specific font with all necessary signatures. So what i need is an extra textfield to be populated with a single character ("a", "b" or "c") based on the selection the user made in the popup menu. If user selects the first name of popup menu, the extra text field should be populated with a simple "a" (in my font "a" is the signature of the first name in popup menu); if second name is selected, the extra text field should be populated with a simple "b", and so on...

Do you guys have any idea how to do this in javascript ?

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

6 replies

Michail Wod.
Participating Frequently
September 14, 2016

got it myelf. it´s pretty easy

if (getField(builder.popupGroup).value = "approver1") this.getField("signature").value = "a";

thanks for reading anyways

try67
Community Expert
Community Expert
September 14, 2016

That's not correct, actually. You used the wrong operator for the comparison. It needs to be:

if (getField(builder.popupGroup).value == "approver1") this.getField("signature").value = "a";

Michail Wod.
Participating Frequently
September 14, 2016

thanks a lot, you are totally right try67

Karl Heinz  Kremer
Community Expert
Community Expert
September 14, 2016

When you look at the text fields properties, you will notice that selecting the font for the information in the field is done via the Field.textFont property. See here for more information: Acrobat DC SDK Documentation - Field.textFont

All you need to do is set the text field value, and then change the font.

There is another way of getting signatures into your field: You can also use a button field and set the button image based on button images that you've stored in your stamp file.

try67
Community Expert
Community Expert
September 14, 2016

I think the field is already set up as having the correct font, and they

just want to know how to set a specific value to it (at least that's what I

understood)...

On Wed, Sep 14, 2016 at 5:18 PM, Karl Heinz Kremer <forums_noreply@adobe.com

try67
Community Expert
Community Expert
September 14, 2016

Sure, it's quite easy... Can you post the code you're currently using, though?