These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Is It Possible To Import Options Into A Combo Box?

kc27
Registered: Oct 7 2006
Posts: 9

One of the Acrobat forms that I maintain has a Combo Boxes with 518 options. Some of those options change several times throughout the year.

I've maintained the options by printing an updated list of the options, comparing them to the ones currently in the Combo Box, then manually keying in the changes. I can pull the latest list of options out of a database, and rather than using the above manual process, would like to clear the existing options from the Combo Box and replace them via some sort of import with the current list of options.

Is this possible? If so, how would I do this?

My Product Information:
Acrobat Pro 8.1.7, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
No, there is nothing in the UI for importing a list into a combo-box but that certainly would be a nice feature to have.

Here is a workaround from a blog entry by Carl Young on using Open Office to create and import items into a list then exporting to a PDF-
http://www.acrobatusers.com/blogs/pdftrainer/importing-lists-combobox-form-fields

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
try67
Expert
Registered: Oct 30 2008
Posts: 2398
True, there's no built-in way to do this. However, it can be automated using a script*.

* Which I happened to develop some time age: http://try67.blogspot.com/2009/11/acrobat-import-text-file-to-drop-down.php

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi try67,

That's a good one. How much does it cost?

P.S. Fillling in your profile with such things as your name, tel# etc would be a nice touch. Here at AUC as well....

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Hi Dimitri,

Feel free to contact me personally for all of this info.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
kc27,
There are many different ways you can import items into a list box. The fact that this is a local task performed in Acrobat Pro makes is relatively easy. Acrobat can import data from text files and connect directly into a database. List items can be imported directly with an FDF file. And there are various other options for importing, parsing, and manipulating data files. However, all the different options require some kind of programming.
Here's an article that explains some of the details of list programming.
http://www.acrobatusers.com/tutorials/2007/js_list_combo_livecycle/

In the sample for this article the list data is in a JavaScript array in a document level script. This would be one easy way you could maintain the item data. Its not optimal but the item data would all be in one place and much easier to update than entering individual list items from the Acrobat UI. If you are not interested in programming you'll need some help with this.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

kc27
Registered: Oct 7 2006
Posts: 9
Thanks everyone for the the help.

I did try the work-around that Dimitri suggested. It did save me the data entry portion of the task. What I forgot to take into account was that replacing a field instead of updating the existing field did change the tab order on the form, but I still saved time by not having to update the options manually.

Thom, I took a look at the example you provided. Is your suggestion of the use of an array intended to get away from using the interface on the combo-box field to maintain any fields that may change? I like that idea. I'm not sure I could quickly convert a list of options to an array as shown in your example. Plus maintaining it when some of the options change or are no longer needed.

I'll take a look at the JavaScript for Acrobat reference document. I do have three to four combo-boxes on the same form that present the same 518 options to the users. Managing the options in one place on the document level would seem to be a superior way to work vs make the same changes four times to the separate combo boxes.

The users filling out the form I create are on Acrobat Reader, but I don't think that would matter for what I am doing.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You are correct that creating an array of list items means you don't use the user interface for the list field. But you do have to maintain code. Maitinance of the code can only be done on Acrobat Pro. But the form runs on both Pro and Reader.

In fact, you could write this as a folder level automation script. Since the code is updating lists, rather than providing an interactive feature, the code does not have to be in the actual PDF. It could be activated from a toolbar button in Acrobat.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script