Skip to main content
Inspiring
August 25, 2022
Question

Master Pages

  • August 25, 2022
  • 1 reply
  • 337 views

How to add master pages and it apply on pages in indesign document using indesign sdk functions by programatically.

For example , creating new document and add number of pages in it by using below code :

InterfacePtr<ICommand> newDocCmd(Utils<IDocumentCommands>()->CreateNewCommand(uiflags));

InterfacePtr<INewDocCmdData> newDocCmdData(newDocCmd, UseDefaultIID());

newDocCmdData->SetCreateBasicDocument(kFalse); 

newDocCmdData->SetNumPages(numPages);

 

I want to know about master pages like this...

This topic has been closed for replies.

1 reply

Community Expert
September 7, 2022

To create new masterspread you can use kNewMasterSpreadCmdBoss command. Within this boss class is an interface IMasterSpreadCmdData using which you can set the no. of pages, position and the base name of the master spread

Once the master spread is created then you can apply it to pages of your document. Do the following

  • Get the reference to the page to which you need to apply the master
  • Query its IMasterPage interface. this interface has a method SetMasterPageData that takes UID of the master page that needs to be applied

-Manan

-Manan
Legend
September 12, 2022

There should also be some command to indirectly invoke SetMasterPageData.

Community Expert
September 12, 2022

Very rightly pointed @Dirk Becker, that would be kApplyMasterSpreadCmdBoss

-Manan

-Manan