Rename PDF form fields in bulk

If you get into the predicament of renaming thousands of form field names like I did, you can use the JavaScript console included in Acrobat, where you can not only execute arbitrary JavaScript code, but also access all contents within the PDF (including form fields). Since there is no native renaming function in the JS-API, the form fields are copied with all their properties and created with new names.

The console must first be activated in Acrobat under "Edit> Settings ..." under "JavaScript": Rename PDF form fields in bulk With "CTRL + J" you activate the JavaScript debugger and select the "Console" under "Display:". If you want to execute any JavaScript code, you enter it, mark it (this is an important step that most people forget) and execute it with "CTRL + ENTER". The result then appears directly below: Rename PDF form fields in bulk The following snippet renames all form fields so that dots (".") Are replaced by hashes ("#"):


The script can handle all form field types (including checkboxes and grouped radio buttons). Rename PDF form fields in bulk