Master Pages

Explorer ,
Aug 25, 2022 Aug 25, 2022

Copy link to clipboard

Copied

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...

TOPICS
SDK

Views

81

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 11, 2022 Sep 11, 2022

Copy link to clipboard

Copied

There should also be some command to indirectly invoke SetMasterPageData.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 12, 2022 Sep 12, 2022

Copy link to clipboard

Copied

LATEST

Very rightly pointed @Dirk Becker, that would be kApplyMasterSpreadCmdBoss

-Manan

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines