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

Insert of image based upon value in number field

Community Beginner ,
Aug 23, 2018 Aug 23, 2018

Copy link to clipboard

Copied

I would like to use a value entered in one or two number entry fields to populate a specific area on a form with graphic images based upon those values? Any suggestions would be helpful.insert

This would ideally involve two 2-digit integer number fields that indicate the images desired.

The images are scaled to fit the desired space however I need to first determine if just one or both fields are populate with a value. Then if only one value is present, that designated image is inserted in the desired space on page two of the form and horizontally centered. If two values are present, then both images are placed side by side in the space on page two and horizontally centered.

Thanks for any input.

TOPICS
Acrobat SDK and JavaScript

Views

336

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
LEGEND ,
Aug 23, 2018 Aug 23, 2018

Copy link to clipboard

Copied

You can do this sort of thing by using buttons, both to display the images and to store the images. To store the images, you can use hidden buttons, perhaps on a hidden template page. You can then use JavaScript to get an image based on the number entered and copy it to a button on page 2. More information is in the Acrobat JavaScript reference, but if you need help, post again.

Images can alternatively be stored as document-level icons, but this is a bit more difficult to set up and manage, but it's a bit simpler to automate.

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 Beginner ,
Aug 23, 2018 Aug 23, 2018

Copy link to clipboard

Copied

Thanks George,


If you could point me to some specific sections of the Acrobat JavaScript Reference that would be great.

Before I trouble anyone too much I'll look into this and document-level icons.

Thanks,
Tom

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
LEGEND ,
Aug 24, 2018 Aug 24, 2018

Copy link to clipboard

Copied

You can use the buttonGetIcon field method to get an icon object that you can then assign to another button using the buttonSetIcon field method. Once you get it working with buttons as the source of the images, you can see if it's advantageous to use document icons as the image storage mechanism. You'd use the doc.getIcon method to get icon object that you can assign to buttons. You'd use the doc.addIcon or doc.importIcon methods to create document icons.

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 Beginner ,
Aug 24, 2018 Aug 24, 2018

Copy link to clipboard

Copied

LATEST

Thanks George,

I am getting much closer to what I need with each cup of Java(Script).

Tom

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