How to Import Multiple Excel Rows into Repeated PDF Form Fields
Question details
The user wants to map multiple rows of data from an Excel spreadsheet into repeatedly occurring form fields on a single PDF page without duplicating the same row across all fields.

- Product
- PDF/Excel
- Device & OS
- not provided
- Scenario
- Filling out a single PDF form that contains a repeating tabular structure by importing bulk data from a spreadsheet.
- Observed behavior
- Standard PDF data import methods incorrectly place a single Excel row's value into every PDF field that shares the same name, rather than distributing subsequent rows into sequential fields.
Ensure your Excel spreadsheet is properly formatted with clear column headers. If you plan to use PDF scripts, ensure your PDF editing software supports JavaScript execution.
Use Microsoft Word Mail Merge to Create the PDF
A more accessible method that avoids complex coding by using the built-in Mailings feature in a word processor to populate data before exporting to PDF.
If you do not strictly need to use the original PDF file as the starting point, rebuilding the form template in a word processor is often the most efficient workaround.
Recreate or open the layout of the form document in Microsoft Word.
Navigate to the 'Mailings' tab and select 'Start Mail Merge', choosing 'Directory' or a standard letter format depending on your layout.
Click 'Select Recipients' and choose 'Use an Existing List' to locate and link your Excel data file.
Use the 'Insert Merge Field' button to place your spreadsheet columns into the document's repeating sections.
Complete the merge by clicking 'Finish & Merge' and print or export the final compiled document to an Adobe PDF.

Use Unique Field Names and Acrobat JavaScript
Ideal if you must use an existing PDF form. It involves renaming fields sequentially and running a custom script to parse CSV data.
Use WPS Office to Mail Merge Excel to PDF
Avoid complex PDF JavaScript coding. With WPS Office, you can easily connect your Excel spreadsheets to a WPS Writer document using the intuitive Mail Merge feature, and instantly export the final batch to a formatted PDF.
- 1. Open WPS Writer: Launch WPS Office, open WPS Writer, and design your repeating form layout.
- 2. Select Data Source: Go to the 'References' tab, click 'Mail Merge', then select 'Open Data Source' to link your Excel spreadsheet.
- 3. Insert Merge Fields: Use the 'Insert Merge Field' option to map your spreadsheet columns into the designated blank spaces in your document.
- 4. Merge and Export: Click 'Merge to New Document' to generate the populated pages, then go to 'Menu' > 'Export to PDF' to save your final file.

Frequently Asked Questions
Why do all my PDF form fields show the exact same Excel row data?
This happens when multiple form fields in the PDF share the exact same name. Standard PDF data imports map the data based on the field name and apply the value to every instance of that field. You must uniquely name each field (e.g., Field1, Field2) to prevent this.
Can I import an Excel file directly into a PDF without scripting?
Yes, but generally only if the PDF form fields perfectly match the Excel column headers and you are importing a single record per form. Importing multiple rows into a single page of repeated fields requires either a custom JavaScript or utilizing a Mail Merge workaround in a word processor.
What format should my Excel data be in for a PDF JavaScript import?
When writing a custom JavaScript for a PDF editor to read external data, you generally need to export your Excel file as a plain text (.txt) or Comma Separated Values (.csv) file. Scripts can parse these raw text formats much easier than a native .xlsx file.




