Bookmark properties

children

name

parent

color

open

style

doc

 

 

children

5.0

 

 

 

An array of Bookmark objects that are the children of this bookmark in the bookmark tree. If there are no children of this bookmark, this property has a value of null.

See also the parent and bookmarkRoot properties.

Type

Array | null 

Access

R

Example

Dump all bookmarks in the document.

   function DumpBookmark(bkm, nLevel)

   {

      var s = "";

      for (var i = 0; i < nLevel; i++) s += " ";

      console.println(s + "+-" + bkm.name);

      if (bkm.children != null)

         for (var i = 0; i < bkm.children.length; i++)

            DumpBookmark(bkm.children[i], nLevel + 1);

   }

   console.clear(); console.show();

   console.println("Dumping all bookmarks in the document.");

   DumpBookmark(this.bookmarkRoot, 0);

color

5.0

D 

 

X 

Specifies the color for a bookmark. Values are defined by using gray, RGB or CMYK color. See Color arrays for information on defining color arrays and how values are used with this property. See also the style property.

Type

Array

Access

R/W (Adobe Reader: R only)

Example

The following fun script colors the top-level bookmark red, green, and blue.

   var bkm = this.bookmarkRoot.children[0];

   bkm.color = color.black;

   var C = new Array(1, 0, 0);

   var run = app.setInterval(

      'bkm.color = ["RGB",C[0],C[1],C[2]]; C.push(C.shift());', 1000);

   var stoprun=app.setTimeOut(

      "app.clearInterval(run); bkm.color=color.black",12000);

doc

5.0

 

 

 

The Doc that the bookmark resides in.

Type

Object

Access

R

name

5.0

D 

 

X 

The text string for the bookmark that the user sees in the navigational panel.

Type

String

Access

R/W (Adobe Reader: R only)

Example

Put the top-level bookmark in bold.

   var bkm = this.bookmarkRoot.children[0];

   console.println( "Top-level bookmark name: " + bkm.name );

The example that follows the children property also uses the name property.

open

5.0

D 

 

X 

Determines whether the bookmark shows its children in the navigation panel (open) or whether the children subtree is collapsed (closed).

Type

Boolean

Access

R/W (Adobe Reader: R only)

parent

5.0

 

 

 

The parent bookmark of the bookmark or null if the bookmark is the root bookmark. See also the children and bookmarkRoot properties.

Type

Object | null 

Access

R

style

5.0

D 

 

X 

Specifies the style for the bookmark’s font: 0 is normal, 1 is italic, 2 is bold, and 3 is bold-italic. See also the color property.

Type

Integer

Access

R/W (Adobe Reader: R only)

Example

The following code puts the top-level bookmark in bold.

   var bkm = this.bookmarkRoot.children[0];

   bkm.style = 2;