PDF Editing Issues

Append Acrobat PDF Form Values to an Existing CSV File

Huma Ashraf ChHuma Ashraf Ch Nov 19, 2026 868 views

Question details

The user needs to add values from an Acrobat PDF form to an existing CSV file.

Append Acrobat PDF Form Values to an Existing CSV File
Product
Adobe Acrobat and Adobe Acrobat Reader
Device & OS
not provided
Scenario
A PDF form collects values that should be added as a new row in an existing CSV file.
Observed behavior
Acrobat JavaScript has no simple built-in command to append to an existing CSV. Reader also restricts operations such as Doc.createDataObject unless the PDF has appropriate usage rights.
Before you start

Check the CSV header names and decide how each PDF form field maps to a column. If using a local script, make sure Python 3 is installed and that you can access the CSV and form values.

Solution 1Recommended

Merge the form values with a standalone Python script

Use a local script to read the existing CSV and write a new file with one additional row.

This approach runs outside Acrobat and does not require Reader to write directly to the CSV. The example expects a UTF-8 CSV with a header row and a JSON object whose keys exactly match those headers.

1
Prepare the form values

Save the collected form values in a file named values.json. For example, if the CSV headers are Name and Email, use {"Name":"Alex","Email":"alex@example.com"}.

2
Save the merge script

Create a file named merge_csv.py containing: import csv, json, sys source, values_file, output = sys.argv[1:4] with open(values_file, encoding='utf-8') as f: values = json.load(f) with open(source, encoding='utf-8-sig', newline='') as src: reader = csv.DictReader(src) headers = reader.fieldnames if not headers or not isinstance(values, dict) or set(values) != set(headers): raise ValueError('JSON keys must match the CSV headers') with open(output, 'x', encoding='utf-8', newline='') as dst: writer = csv.DictWriter(dst, fieldnames=headers) writer.writeheader() writer.writerows(reader) writer.writerow(values)

3
Run the merge

Open a terminal in the folder containing the files and run: python merge_csv.py existing.csv values.json merged.csv. Use python3 instead of python if that is the command for Python 3 on your system.

4
Check the result

Open merged.csv in a spreadsheet application and confirm that the new row and existing data are correct. If needed, manually replace the original CSV with the verified file.

Merge the form values with a standalone Python script
Output file must be new: The script refuses to overwrite an existing output file. Choose a different output name or remove an unwanted previous output before running it again.
Free Microsoft Office alternative

Review CSV Data and PDFs with WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface for reviewing spreadsheet data and PDFs. Its Microsoft Office format compatibility makes it easier to move existing documents. It does not remove Acrobat Reader's JavaScript security restrictions or automatically append PDF form values to a CSV.

Open and review CSV rows in WPS SpreadsheetView PDFs alongside spreadsheet dataCompatible with Microsoft Excel XLSX files and other Office formatsFamiliar interface for working with existing documents
microsoft office alternative - wps office

Frequently Asked Questions

Can Acrobat JavaScript append directly to an existing CSV?

Acrobat does not provide a simple built-in command for directly appending a form row to an existing CSV. Use an external script or a server application to read and update the data.

Why does Doc.createDataObject fail in Acrobat Reader?

Reader restricts operations such as Doc.createDataObject unless the PDF has appropriate usage rights. Those rights are generally unavailable for ordinary PDFs.

How do I keep commas in form values from breaking the CSV?

Use a CSV library, such as Python's csv.DictWriter, rather than joining values with commas. The library quotes fields when necessary.

Can I automate the merge without giving the PDF access to a local file?

Yes. In Acrobat's Prepare a Form tool, configure a button with a Submit a form action. A server endpoint can receive the values and update the CSV outside the PDF application.