Skip to main content
Participant
April 6, 2018
Answered

Get Page Number Field Exists Within Using Javascript

  • April 6, 2018
  • 1 reply
  • 2060 views

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));

}

This topic has been closed for replies.
Correct answer try67

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

zero-based number or array of numbers.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
April 6, 2018

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

zero-based number or array of numbers.

Participant
April 6, 2018

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.

try67
Community Expert
Community Expert
April 6, 2018

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