SetInitialPositionExact

These examples assume that there is a chapter called "Chpater 2" in the publication and it is set to open in a new window.

Example 1:

To set a new chapter window to appear at 200 pixels across and 100 pixels down the display, and then display the first page in that chapter:

// Find the chapter object to modify
var Chap = GetPublication().FindChild("Chapter 2");

// To set the position at 200 pixels across and 100 pixels down
Chap.SetInitialPositionExact( 200, 100 );

// Open the chapter by going to the first page in it.
GotoPage( Chap.GetFirstChild().GetName() );

Example 2:

To reset the initial position of the chapter to the defaults specified in the editor and open the first page in that chapter:

var Chap = GetPublication().FindChild("Chapter 2");
Chap.SetInitialPositionExact(-1,-1);
GotoPage( Chap.GetFirstChild().GetName() );

Close