setPage

Syntax: setPage document, pageNumber

The setPage command sets the "current" page of the document, where subsequent text and graphic elements added to the document will be placed. If the pageNumber value is greater than the number of pages currently in the document, new pages will be added, and the requested page will still become the "current" page.

Calling setPage with a value of 0 will set the master page to be the current page. Any text or graphic element added to the master page will be drawn on every page of the document, beneath the contents of each individual page.