0% found this document useful (0 votes)
25 views1 page

Solutions 16

This document provides solutions for manipulating spreads and pages in a target document using commands like kCreateSpreadFromSpreadCmdBoss and kDuplicateSpreadCmdBoss. It outlines methods for iterating through content using IHierarchy and acquiring references to pages through the IMasterPage interface and IPageList. Additionally, it includes sample code references for practical implementation in Adobe InDesign programming.

Uploaded by

Charana Studios
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

Solutions 16

This document provides solutions for manipulating spreads and pages in a target document using commands like kCreateSpreadFromSpreadCmdBoss and kDuplicateSpreadCmdBoss. It outlines methods for iterating through content using IHierarchy and acquiring references to pages through the IMasterPage interface and IPageList. Additionally, it includes sample code references for practical implementation in Adobe InDesign programming.

Uploaded by

Charana Studios
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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