Skip to main content
Known Participant
April 14, 2017
Question

Understanding a Collection object and CollectionField objects

  • April 14, 2017
  • 2 replies
  • 442 views

After referencing the SDK PDF, I am trying to understand

1.  What the collection object refers to

2.  What the collectionField object refers to

3.  How to create a collectionField object

To test these things out, I tried the following code in the Console window and in a field with Mouse Up as a trigger.  Neither one worked.  I guess I'm not understanding the definition of a collection object and a collectionField object.  The PDF form I am testing on has many fields on it so I would think there are enough fields to test on.

var c = this.collection;

for (var i  = 0; c.fields; i++)
{
app.alert(c.fields);

}

This topic has been closed for replies.

2 replies

Bernd Alheit
Community Expert
Community Expert
April 15, 2017

Open a portfolio in Adobe Acrobat and try this:

for (var i in collection.fields) console.println(i);

Legend
April 15, 2017

The "field" in collectionField is nothing to do with form fields, and the quantity of form fields is not relevant.

"Collection:

A collection object is obtained from the Doc.collection property. Doc.collection returns a null value when there

is no PDF collection (also called PDF package and PDF portfolio)."

So collections and the related objects are used to reference the individual files in a PDF Portfolio. (You can create these using Create PDF from Multiple Files). Collection fields are a way of organising how information about a portfolio appears on screen.