Get Page Number Field Exists Within Using Javascript

New Here ,
Apr 06, 2018

Copy link to clipboard

Copied

Is it possible to get the page number that a field exists within using javascript?  I have a 5 page form with 205 fields and I have built the code to export the field property values, for each field.  I would now like to add code to include the page the field exists within.  I have searched and cannot find anything that states anything regarding form pages.  Below is my code to write to the console the form properties.  Once I get it the way I want, I will have it write to an array instead of to the console and then export the array values to a csv file.

for (var i = 0; i < this.numFields; i++) {

   var f = this. getField(this.getNthFieldName(i));

   console.println(i + " | " + (f.type) + " | " + (f.name) + " | " + (f.readonly) + " | " + (f.required));

}

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Each field has a property called page that returns that information as a

zero-based number or array of numbers.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

316

Likes

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

Get Page Number Field Exists Within Using Javascript

New Here ,
Apr 06, 2018

Copy link to clipboard

Copied

Is it possible to get the page number that a field exists within using javascript?  I have a 5 page form with 205 fields and I have built the code to export the field property values, for each field.  I would now like to add code to include the page the field exists within.  I have searched and cannot find anything that states anything regarding form pages.  Below is my code to write to the console the form properties.  Once I get it the way I want, I will have it write to an array instead of to the console and then export the array values to a csv file.

for (var i = 0; i < this.numFields; i++) {

   var f = this. getField(this.getNthFieldName(i));

   console.println(i + " | " + (f.type) + " | " + (f.name) + " | " + (f.readonly) + " | " + (f.required));

}

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Each field has a property called page that returns that information as a

zero-based number or array of numbers.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

317

Likes

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
Apr 06, 2018 0
Most Valuable Participant ,
Apr 06, 2018

Copy link to clipboard

Copied

Each field has a property called page that returns that information as a

zero-based number or array of numbers.

Likes

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
Reply
Loading...
Apr 06, 2018 0
New Here ,
Apr 06, 2018

Copy link to clipboard

Copied

Thank you! That was exactly what I needed.  Where can I get a reference guide to all the properties available to all objects in a pdf form?  Thank you in advance.

Likes

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
Reply
Loading...
Apr 06, 2018 0
Most Valuable Participant ,
Apr 06, 2018

Copy link to clipboard

Copied

You need to get the "JavaScript for Acrobat API Reference": Adobe - Acrobat Developer Center | Adobe Developer Connection

Likes

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
Reply
Loading...
Apr 06, 2018 0
New Here ,
Apr 06, 2018

Copy link to clipboard

Copied

Thank you.  I downloaded it and will use that to review. 

Likes

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
Reply
Loading...
Apr 06, 2018 0