Skip to main content
Participant
June 29, 2015
Question

How to create a TOC programmatically with FDK?

  • June 29, 2015
  • 3 replies
  • 473 views

We need to create the Table Of Content programmatically for our customer with FDK. There is a Menu in Special>Table of Content.. in FM to do it, however we need to do the same with FDK API. Any help or hint are appreciate! Thank you

This topic has been closed for replies.

3 replies

Participating Frequently
July 2, 2015

If I were doing this, I'd do the following:

  1. Check if the book already has a TOC. If not:
    • Copy a template file to the correct location in the filesystem
    • Add the TOC file into the book; see "Frame Book Architecture" in the FDK Programmer's Guide.
  2. Check that the TOC is correctly configured for which paragraphs to fetch etc. You do this by setting properties of the book component object.
  3. Start a generate/update using F_ApiUpdateBook() or F_ApiSimpleGenerate().

I'm sorry, but work commitments mean that I don't have time to do more than offer this outline.

frameexpert
Community Expert
Community Expert
June 29, 2015

The function to create a TOC is not exposed to the FDK or ExtendScript (or FrameScript). You have to basically use code to find the paragraphs you want, create a TOC document and make the appropriate entries in the TOC. It is not trivial by any means. If you have budget and want to explore this further, please contact me offlist and we can discuss it. Thanks. -Rick rick at frameexpert dot com

www.frameexpert.com
Jeff_Coatsworth
Community Expert
Community Expert
June 29, 2015

Might have more luck if you looked in the FM Scripting forum ;>)