• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to list all field names in tab order in Adobe Acrobat?

Engaged ,
Nov 26, 2024 Nov 26, 2024

Copy link to clipboard

Copied

Hello,
I'm working on a PDF form in Adobe Acrobat Pro DC, and I need to extract the names of all form fields in their tab order. Is there a way to do this using JavaScript or any built-in functionality?

So far, I’ve tried checking the field names manually from the Fields panel, but it’s tedious for large forms. I’ve also looked through the JavaScript documentation but haven’t found a clear solution.

Could someone guide me on how to automate this process or point me to the right resources?
Thank you!

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.
TOPICS
JavaScript , PDF , PDF forms

Views

209

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Nov 26, 2024 Nov 26, 2024

No, not possible in Acrobat. You can only infer it if you know that the tab order is based on rows or columns, but if it's unspecified (ie. custom set) then a script has no way of knowing what it is.

Votes

Translate

Translate
Community Expert , Nov 26, 2024 Nov 26, 2024

You can semi-automate the list extraction.  Here's how:

1)  Run a script in the console that sets an On Focus action for every field, that prints the field name to the console.

for(var i = 0; i < this.numFields; i++)
{
var fieldName = this.getNthFieldName(i);
var fld=this.getField(fieldName);
fld.setAction('OnFocus','console.println(event.target.name)');
}

2) Clear the console.

3) Click the first field in the tabbing order and hold down the tab key until you get the last field.

4)  Open the cons

...

Votes

Translate

Translate
Community Expert ,
Nov 26, 2024 Nov 26, 2024

Copy link to clipboard

Copied

No, not possible in Acrobat. You can only infer it if you know that the tab order is based on rows or columns, but if it's unspecified (ie. custom set) then a script has no way of knowing what it is.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 26, 2024 Nov 26, 2024

Copy link to clipboard

Copied

Thank you @try67 

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2024 Nov 26, 2024

Copy link to clipboard

Copied

You can semi-automate the list extraction.  Here's how:

1)  Run a script in the console that sets an On Focus action for every field, that prints the field name to the console.

for(var i = 0; i < this.numFields; i++)
{
var fieldName = this.getNthFieldName(i);
var fld=this.getField(fieldName);
fld.setAction('OnFocus','console.println(event.target.name)');
}

2) Clear the console.

3) Click the first field in the tabbing order and hold down the tab key until you get the last field.

4)  Open the console and copy the list.

5)  Close the document without saving so field actions won't be saved.

This will skip hidden fields.  If you need them in the list you can always unhide all fields first.  It also won't show the widget number of duplicate fields.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2024 Nov 26, 2024

Copy link to clipboard

Copied

I would also suggest adding an alert to the script in the last field in the tabbing order:  app.alert("List is finished").  This way you can hold down the tab key and zip through all the fields quickly.  When the alert pops up the tabbing won't start again so you can let go of the tab key.  You will have to dismissed the alert before anything else happens.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2024 Nov 26, 2024

Copy link to clipboard

Copied

Nice workaround!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2024 Nov 26, 2024

Copy link to clipboard

Copied

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 29, 2024 Nov 29, 2024

Copy link to clipboard

Copied

LATEST

Thank you @PDF Automation Station 

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines