You are on page 1of 1

CHAPTER 1: Layout Spreads and pages 16

Solution

To append the duplicated spread to the spread list (ISpreadList) in the target document, process
kCreateSpreadFromSpreadCmdBoss.

To control where in the spread list (ISpreadList) the spread is positioned:

1. Process kNewSpreadCmdBoss to create a new spread at a position of your choice in the target
document’s spread list.

2. Process kDuplicateSpreadCmdBoss to copy the source spread.

Iterating through the content of a spread


Solution

Use IHierarchy on kSpreadBoss.

Related documentation

 “Iterating through page content”.

 “Iterating through layer content”.

Sample code

 SnpInspectLayoutModel

 In the “Layout Fundamentals” chapter of Adobe InDesign Programming Guide, see two examples: “Code
that Iterates through Spreads and Visits their Children via IHierarchy” and “Code that Iterates through
Spreads and Filters Items by Page via ISpread.”

Acquiring a reference to a page


Solution

A page (kPageBoss) is characterized by the IMasterPage interface. A UIDRef that can instantiate an
IMasterPage interface is a page.

If you have a document (see “Acquiring a reference to a document”) and want to iterate through its pages,
use IPageList. See “Acquiring a reference to a page”.

If you have a spread (see “Acquiring a reference to a spread”) and want to iterate through its pages, use the
following:

 ISpread::GetNumPages and ISpread::GetNthPageUID provide easy access to the pages.

 ISpread::QueryPagesLayer provides access to the spread layer that stores the pages on its IHierarchy.
The child boss objects of this spread layer are the pages owned by the spread.

If you have a page item and want to know the page, if any, on which it lies or is drawn, use the following:

You might also like