Skip to main content
Participant
Jan 21, 2025 10:47 PM UTC
Answered

Copying Field Accessibility Information

I wrote a script to rename fields by creating new fields and deleting the old one, but I am having a problem with the accessibility on the fields. Before I run the script the reader reads what is in the tooltip just fine, but after it is not read. It might be that the field is just not tagged? Is there a way I can copy the tag or retag it?

 

Here is the section of my code that copies all the properties of the old field to the new field.

 

var propertiesToCopy = [
        "value", "borderStyle", "strokeColor", "lineWidth", "rotation", "fillColor", "userName",
        "readonly", "doNotScroll", "display", "textFont", "textColor", "textSize", "richText",
        "richValue", "comb", "multiline", "charLimit", "fileSelect", "password", "alignment",
        "buttonAlignX", "buttonAlignY", "buttonFitBounds", "buttonScaleHow", "buttonScaleWhen",
        "highlight", "style", "numItems", "editable", "multipleSelection"
    ];

    propertiesToCopy.forEach(function (prop) {
        try {
            if (prop in oldField) {
                newField[prop] = oldField[prop];
            }
        } catch (e) {
            // Suppress expected errors
        }
    });
try67
try67Correct answer
Community Expert
Jan 21, 2025 11:03 PM UTC

You will lose all tags associated with the fields in this process. JS has no way to read or write them.

2 replies

JR Boulay
Community Expert
Community Expert
Feb 8, 2025 2:33 PM UTC

[MOVED TO THE ACROBAT DISCUSSIONS]

Translate
Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Jan 21, 2025 11:03 PM UTC

You will lose all tags associated with the fields in this process. JS has no way to read or write them.

Translate