Importing or copying Excel list into listbox?

Community Beginner ,
Feb 14, 2018 Feb 14, 2018

Copy link to clipboard

Copied

Hello,

Anyone out there knows how to Importing or copying Excel list into listbox? The Adobe API/UI does not support this.

Only found http://acroscript.net/pdf/demos/comboPopulateTest.pdf

But no code displaies.

Thanks

George

TOPICS
PDF forms

Views

1.1K

Likes

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

correct answers 1 Correct answer

Community Beginner , Feb 15, 2018 Feb 15, 2018

Finally, I got the solution myself!.

There is not any API or instrruction in Adoba API doc.

The approaching is:

(1) Create a text control, one button and one listbox.

(2) Copy and past the excel sheet columns on the text field.

(3) Using Java script to load the text to the listbox.

(4) Copy the loaded listbox to any PDF form you like.

Here is the code to load the test to listbox:

(function () {

// Get the contents of the multi-line text field

// where the list values have presumably been pasted or otherw

...

Likes

Translate

Translate
Community Expert ,
Feb 14, 2018 Feb 14, 2018

Copy link to clipboard

Copied

You can use this tool I've developed to do it (you would need to first save the Excel file as a plain-text file, though): Custom-made Adobe Scripts: Acrobat -- Import Items from a Text File to a Combo-Box or List Field

Likes

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 ,
Feb 15, 2018 Feb 15, 2018

Copy link to clipboard

Copied

Finally, I got the solution myself!.

There is not any API or instrruction in Adoba API doc.

The approaching is:

(1) Create a text control, one button and one listbox.

(2) Copy and past the excel sheet columns on the text field.

(3) Using Java script to load the text to the listbox.

(4) Copy the loaded listbox to any PDF form you like.

Here is the code to load the test to listbox:

(function () {

// Get the contents of the multi-line text field

// where the list values have presumably been pasted or otherwise entered

    var sItems = getField("items").valueAsString;

// Alert the user if the field is empty

    if (!sItems) {

        app.alert("Please enter a list of items in the text field below.", 3);

        return; 

    }

// Create the array of items by splitting the string from the field

    var aItems = sItems.split(/\r/);

    //

getField("Yourlistbox").setItems(aItems);

})();

I hope that this can help others.

George

Likes

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 ,
Feb 15, 2018 Feb 15, 2018

Copy link to clipboard

Copied

LATEST

well you know, there are a couple of free downloads for this.  George Johnson has one and I've got one here:

Free Sample PDF Files with scripts

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

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