Copy link to clipboard
Copied
Can anyone help me with this?? I have a list of 115 departments that I would like to populate the drop down box in an acrobat pdf form and dont have the time to enter them one by one.. Is it possible to either import this list or do a copy and paste?? Please help.. Thanks so much!!
Here's a link to a very simple PDF that demonstrates how you can populate a combo box (aka drop down) with a list of items that can be pasted into a text field, after copying them from Excel (or some other source): https://acrobat.com/#d=sIJoabh12oYOY19AuTZ9yw
The idea is that once the drop-down is populated after clicking the "Populate combo box" button, you can copy & paste the field to your form. Be sure to check for duplicates and blank lines.
Copy link to clipboard
Copied
Extracting items from an AcroForm list is pretty simple. Run this code in the console window,
var oFld = this.getField("MyList");
for(var i=0;i<oFld.numItems;i++)
console.println(oFld.getItemAt(i,true);
This code will print the export values of the list items in the console window.
Copy link to clipboard
Copied
Yes, it worked. Thanks a lot.
Copy link to clipboard
Copied
Me too, I already have a license, from my job. I did'nt find a place to log in either....?
Copy link to clipboard
Copied
hello,
i want to imrport a list from excel that contains two columns, one with the value that i want to appear in the drop down list and the another one with de export value.
do you know how to do this?
Copy link to clipboard
Copied
Hi, George,
This Acroscript is great! I wondering how to use this hack in Adobe Acrobat DC Pro. I'm in Prepare Form --> Dropdown properties. I've copied my list from the form you created, but where would I paste this data in the Dropdown properties?
Please let me know if you need more information. I'm using Pro DC on a Windows OS.
Thanks!
Cheers,
Elizabeth
Copy link to clipboard
Copied
First off , this isn't a hack. It's just list programming with Acrobat JavaScript. populating any type of PDF list with data is very simple.
I haven't seen Georges sample, but if he's filling data from items pasted into a text field, then there are no properties on the drop down that need to be adjusted. Instead the data is loaded by pressing a button. The code on the button must be something like this
this.getField("DropDown").setItems(this.getField("TextField").value.split(/\s*/g));
Where "DropDown" is the name of the dropdown list and "TextField" is the name of the text field where the excel data is pasted.
The idea of Georges from is that you use it to create a filled droplist, then copy that dropdown onto your own form.
Here are some articles that explain list programming:
https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm
https://acrobatusers.com/tutorials/js_list_combo_livecycle
Copy link to clipboard
Copied
Um, okay.
I'm not savvy enough to try and use JavaScript in Acrobat, I've added a Dropdown list (via Prepare Form) in Pro DC. When that Dropdown list is selected on the form, in Dropdown properties --> Options, there is an Item field to add data to create the dropdown list. I don't want to add them manually, as there are several, I want to batch add.
Perhaps this is not possible without scripting, but, from what I've read here in the forums, George's form appears to be what I need (I think). I thought by adding text to his script, I could copy that into my form.
But in Dropdown properties --> Options, there is no where for me to paste that much text. It appears that you can only add one item at a time to populate the list. I'm not sure what I'm missing...
Again, I don't want to do this via Java (if that's possible). I'd rather do it GUI-style...
Copy link to clipboard
Copied
I'd rather do it GUI-style...
If that was possible we wouldn't use a script, but it's not.
Feel free to make a feature request here: Feature Request/Bug Report Form
Copy link to clipboard
Copied
I think I made this too complicated.
If you have access to the form George made, then use it to create your filled list. As I already stated, the purpose of this form is to give you a copy paste method for filling a dropdown with entries. No scripting needed on your end.
If you don't have the form, then I'll create one and upload it to the free content at http://www.pdfscripting.com
Copy link to clipboard
Copied
Hi, Thom,
Glad to hear that no scripting is needed. So we're back to my original question: where does this data get pasted? There is no "Populate Combo Box" anywhere in the Dropdown Properties of Pro DC. I'm in the Options tab of the Dropdown Properties, but even pasting the copied text from George's form in the Item field of that tab does not allow for more than one item at a time. Is there a different tab I should be using, a different field?
Copy link to clipboard
Copied
I think this was stated previously so I didn't address it. There is no place to paste a list of entries into the properties dialog of a dropdown. That's the reason George created the form. It should have a text box on it somewhere, and that is where you paste your list of entries.
Regardless, Download the form here. It is the first sample download in the list and it contains clearly marked fields and instructions for this same process.
Free Sample PDF Files with scripts
Copy link to clipboard
Copied
Hi, Thom,
Thank you for providing the link, the instructions were most helpful.
Cheers,
Elizabeth
Copy link to clipboard
Copied
Hi Thom,
You are such a help, I tried dropdown thing and it worked. Thanks a lot!
I have a question if you can solve it will be great. I want to GET THE SELECTED ITEM OF A DROPDOWN and COPY TO ANOTHER TEXTBOX. How can I do that? Can you please help.
Thanks in advance.
Copy link to clipboard
Copied
Here are two articles that cover exactly this topic and more:
https://acrobatusers.com/tutorials/list_and_combo_in_lc
https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm
Copy link to clipboard
Copied
Hello: I cannot download the form, could you create a free one?
Copy link to clipboard
Copied
The link to the form in the AcrobatUsers.com article is still good. Here it is:
https://www.windjack.com/PDFSamples/ListPrograming_Part2_AcroForm.pdf
Copy link to clipboard
Copied
Is there a way to set the export values of a dropdown in this manner too?
Copy link to clipboard
Copied
Yes, but the code needs to be changed to accomodate this. Do you have two columns in your excel file? one for the display value and one for the export?
Copy link to clipboard
Copied
Yes, I do.