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

Set list of items for a Combo Box or List Box

Guest
Apr 29, 2016 Apr 29, 2016

Copy link to clipboard

Copied

Hi:

I am trying to create a drop down list in my PDF form from a list in Microsoft Excel. I would like to paste this information rather than by entering each item one at a time. How can I accomplish this?

TOPICS
Acrobat SDK and JavaScript

Views

2.9K

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 ,
Apr 29, 2016 Apr 29, 2016

Copy link to clipboard

Copied

You cannot paste the list directly, but you an use a JavaScript to set your items. One option would be to run such a script in the JavaScript console. The method you would need to use is Field.setItems():

Acrobat DC SDK Documentation

The documentation does have sample scripts that demonstrate how you would do that.

What I usually do is export the list from Excel as a CSV or tab separated text file, then load that file into a text editor and add all the information that is required to convert a text list into a valid script to set the items of a dropdown or a list box control. 

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 ,
Apr 29, 2016 Apr 29, 2016

Copy link to clipboard

Copied

Here's a link to a demo file that allows you to paste a list of items and have it automatically populate a combo box: http://acroscript.net/pdf/demos/comboPopulateTest.pdf

Once the combo box is populated, you can copy and paste it to your form. It's possible to change things to allow export values as well.

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 ,
Apr 30, 2016 Apr 30, 2016

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
Community Expert ,
May 02, 2016 May 02, 2016

Copy link to clipboard

Copied

LATEST

Another option in addition to those described is this tool I've developed: Custom-made Adobe Scripts: Acrobat -- Import Items from a Text File to a Combo-Box or List Field

It lets you import the items from a text file into a combo-box or a list-box field, including the option to embed the source file into the PDF (so that you can edit it directly and it will update the list) as well as to import not just the display values for the items but also their export values.

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