Skip to main content
Inspiring
November 26, 2013
Question

TOC-How to get table of contents details

  • November 26, 2013
  • 1 reply
  • 823 views

Hi All,

        Can someone help me out to get the information of TOC.

For example TOC-Title,cotents texts and its refering page number.

There are interfaces provided in SDK help but no help how to get this interfaces properly.

TOCEntrySortInfo

TOCEntryInfo

ITOCStyleInfo

ITOCStyleNameTable

More importantly how to get this interface.

Thanks

Qamar

This topic has been closed for replies.

1 reply

Legend
November 27, 2013

First for the simple one:

the bottom of the SDK reference for an Interface lists the boss classes, e.g. for ITOCStyleNameTable use docs/references/sdkdocs/html/classITOCStyleNameTable.html .

You find that interface on kDocWorkspaceBoss and kWorkspaceBoss, any SDK example that deals with the workspace (preferences) will take you there.

ITOCStyleInfo is on kTOCStyleBoss, managed by that ITOCStyleNameTable.

A full text search for TOCEntryInfo will show you that it is only exposed in ITOCCmdData, thus part of a command. In other words you don't get them, you set them as parameter to the command. Maybe you've already found http://forums.adobe.com/message/3766488 ?

TOCEntrySortInfo is only used with EntryNode, which at first sight looks quite internal to TOC sorting. I'm just guessing here though. Probably it is only exposed because it resides in the same header file as other TOC...Info classes, and only populated while kCreateTOCCmdBoss is doing its job. I've just looked but found no related notification (observer or responder) where you might peek at that data.

If you're looking for the actual TOC output, the simplest approach would be to read it from the TOC story, or maybe capture the chunks with a

kEditCmdPostProcessService / IID_ITEXTEDITPOSTPROCESS while the TOC is rebuilt.

Dirk

muQamarAuthor
Inspiring
November 27, 2013

Hi Dirk,

           Thank for your help.Now i am able to get following APIs successfully

ITOCStyleNameTable

ITOCStyleInfo

Also getting the TOC title,style but i want TOC-content text and its referring page index.

I am not getting clearly TOC Story (Chunk)or kEditCmdPostProcessService / IID_ITEXTEDITPOSTPROCESS. point you have mentioned mean how to get this.

InterfacePtr<ITOCCmdData> iTOCCmdData(::CreateObject2<ITOCCmdData>(kCreateTOCCmdBoss));

I am getting ITOCCmdData pointer also but doesn't getting the below methods

GetTextModelUIDRef()

GetTOCEntryInfoList()

GetTOCTitle()

Please let me know if you can help me more on this query.

Thanks

Qamar

muQamarAuthor
Inspiring
December 3, 2013

Hi Dirk,

   Now i am taken the approach to create TOC frame as mentioned in the discussions.

http://forums.adobe.com/message/3766488 ?

But from given code i am unable to get valid TOC UIDRef which get created after command process.So if possible can you help me out on this query more.

Thanks

Qamar