How to Export Combo Box Values from a PDF to Text, CSV, or Excel
Question details
The user needs to extract all display items and export values from combo boxes within a PDF document and save them in a structured format like Text, CSV, or Microsoft Excel.

- Product
- Adobe Acrobat PDF
- Device & OS
- not provided
- Scenario
- Managing PDF forms and needing to pull the full list of available dropdown items from combo boxes for external data analysis or documentation.
- Observed behavior
- The user wants to automate the extraction of both display values and export values from combo box fields without manually copying each item.
Ensure you have a PDF editor with a built-in developer JavaScript console enabled (such as Adobe Acrobat Pro). Back up your PDF file before running any scripts to prevent accidental modifications to your form fields.
Extract Combo Box Values via JavaScript Console
Run a custom JavaScript code snippet in the PDF editor's JavaScript console to loop through all form fields and print the combo box values.
This method requires using the built-in JavaScript console found in professional PDF editing software like Adobe Acrobat. The script identifies all combo box fields in the document and iterates through their list items to print both the export value and the display value.
Open your PDF document in Adobe Acrobat. Press 'Ctrl + J' (Windows) or 'Cmd + J' (Mac) on your keyboard to open the JavaScript Debugger and Console window.
If there is any existing text in the console window, clear it so you can easily read your new output. You can do this by clicking the trash can icon or selecting the text and deleting it.
Paste the following script into the console: for (var i = 0; i < this.numFields; i++) { var oFld = this.getField(this.getNthFieldName(i)); if (oFld != null && oFld.type == "combobox") { for (var j = 0; j < oFld.numItems; j++) { console.println(oFld.getItemAt(j, true) + ": " + oFld.getItemAt(j, false)); } } }
Highlight the pasted code and press 'Ctrl + Enter' (or 'Enter' on the numeric keypad) to run the script. The console will print out the export values and display values of every combo box item.
Highlight the printed results in the console, right-click, and select 'Copy'. You can now paste this data directly into a plain text file (TXT), save it as a CSV, or paste it into a Microsoft Excel (XLSX) worksheet.

Edit and Convert PDF Forms Easily with WPS Office
While executing advanced JavaScript commands requires highly specialized developer tools, WPS Office provides a lightweight, highly compatible, and user-friendly alternative for everyday PDF editing, form filling, and document conversions. It seamlessly handles PDFs alongside Word, Excel, and PowerPoint files in one tabbed workspace.
- 1. Download and Install: Download WPS Office from the official website and install it on your device.
- 2. Open Your PDF: Launch WPS Office and open your PDF document containing the forms or tabular data.
- 3. Convert PDF to Excel: Navigate to the 'Tools' tab and click on 'PDF to Excel'. This allows you to extract tabular data directly into a spreadsheet format without needing to use JavaScript.
- 4. Save Your Data: Review the extracted spreadsheet and save it as an XLSX or CSV file for further data analysis.

Frequently Asked Questions
What is the difference between an export value and a display value in a PDF combo box?
The display value is the text that the user actually sees in the drop-down list on the PDF form. The export value is the backend data associated with that choice, which is sent to a database or used in calculations when the form is submitted.
Can I export PDF form data directly to a CSV without using JavaScript?
Yes, standard PDF editors allow you to export user responses by going to 'Prepare Form' > 'More' > 'Export Data' and choosing CSV or XML. However, this only exports the choices the user selected, not the entire list of possible options available in the combo box.
Why doesn't Ctrl + J open the JavaScript console for me?
The Ctrl + J shortcut is specific to professional versions of Adobe Acrobat (like Pro or Standard). If you are using a basic PDF reader, a web browser, or a different third-party viewer, the developer JavaScript console is likely not supported or accessible via that shortcut.
How do I separate the extracted text into Excel columns?
After pasting your extracted console output into Excel, highlight the column containing the pasted text. Go to the 'Data' tab, click 'Text to Columns', select 'Delimited', click Next, and check 'Other'. Enter a colon (:) in the box and click Finish. This will split your export values and display values into adjacent columns.




