Copy link to clipboard
Copied
Hello,
I have an Editable PDF with several hundred text fields. I want to
1. As a custom format script to all of them
2. Change to Rich Text Formatting in Properties
Is there any way to do this via bulk editing / all at once?
Thanks in advance.
Karen Thring
Copy link to clipboard
Copied
Yes, this can be done using a script that iterates over all the fields and then edits the text fields in this specific manner.
The specific commands you should be using are setAction for #1 and richText for #2.
If you don't want to spend the time writing this script you can use these tools I've developed to do it easily and quickly:
Custom-made Adobe Scripts: Acrobat -- Mass Edit Fields Properties
Custom-made Adobe Scripts: Acrobat -- Mass Edit Fields Actions
Copy link to clipboard
Copied
If you feel comfortable with JavaScript, then this is very simple to do with an Action. The "Rich Text" property is something you can look up in the API documentation: Acrobat DC SDK Documentation​
All you need to do is loop over all fields in the document, look for text fields, and then set this property:
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f.type == "text") {
f.richText = true;
}
}
It gets a bit more complicated if you want to assign text to these fields, and even more complex if it's actually Rich Text.