Creating Interactive PDFs from InDesign (6)

Digitip 085 – Adobe InDesign CS4: A story about Table of Contents and Bookmarks

This is the 6th tip in a series of tips on Interactive PDFs. We’ve learnt in previous tips to create buttons, add cool roll over effects, add actions to buttons, create hyperlinks to pages and more. In this tip we’ll look at how we can create a Table of Contents in InDesign and automatically use the inclusion of an interactive Table of Contents during export to PDF as well as create navigational bookmarks in the PDF. The preparation as we’ll see is all on how we define and set-up our Table of Contents.

085-001

Building a Table of Contents

Rule number 1: In order to automatically generate a Table of Contents list in an InDesign document, you must use paragraph style consistently throughout your document.

So what do paragraph styles have to do with building a Table of Contents? Through-out your InDesign document (or document that is part of an InDesign Book), you use paragraph styles to format the text in the document. Styles such as “Heading1″, “Heading2″, “BodyText”, “Normal” and so on. Generally when we create a Table of Contents we want to create a copy of text, such as headings that is used through-out the document, or figure-names or table-names etc.  InDesign’s Table of Contents feature can automatially filter out this text from an InDesign document IF you have formatted those headings with a unique paragraph style. Let’s say Heading1. Here’s how it all works together…

Step 1: Format headings etc. consistently with paragraph styles

085-01

Step 2: Design your Table of Content

First of all, if you are looking at building a Table of Contents from different heading levels, consider how many levels deep you’d like the Table of Contents to be. For example will you only include “Heading 1″ text? Or do you want to see different levels, such as “Heading 1″ and “Heading 2″?

Once you’ve determine this think ahead a little. When the text is formatted in the Table of Contents:

  • Would you like to see a Page Number?
  • If Yes, will that be preceding the heading text that is filtered out of the document? or will it follow the text?
  • If there is a page number, would you like to separate it from the text in some way. Say by entering a tab-character, or maybe even an En-Space then a Tab-character? etc.
  • Build a small temporary Table of Contents in which you mimic this formatting in your document.
  • Also include the Table of Contents Title… that is if you want to have the ability to also generate this text during the TOC creation.

085-02

  • With the formatting in place, create some paragraph styles specifically designed to format your Table of Contents.
  • In the sample here, we’re keeping things pretty simple. Just a single level table of contents preceded by a title.
  • Clear the content from the dummy Table of Contents text frame, and leave the frame on the page.

Step 3: Defining a New Table of Contents Style

Time to define your Table of Contents Style. From the Layout Menu choose Table of Contents Styles…

085-03

The Table of Contents Styles dialog appears. Click New… to define a new style.

085-041

Click the More Options button to see the full TOC dialog.

085-05

Let’s review this dialog top to bottom…

First of all we’ll name the Table of Content Style. Let’s say “Newsletter TOC”

The Title refers to the first bit of text that preceeds the contents listing itself. We’ll make this “In this week’s edition:”.  The paragraph style next to it is the style used to format this text. We’ve created the “TOC_Title” style for this earlier.

Now we get to the good bits. Which text formatted with which paragraph style do you want to copy from the InDesign document into the Table of Contents? Answer in this example ChapterTitle_Black and ChapterTitle_White.

From the list of Other Styles you can select any of the paragraph styles that need to be included in the Table of Contents. To select multiple non-continuous styles hold down the Cmd (Mac) or Ctrl (PC) key as you are clicking style names. Press shift to select a continuous style range.

085-06

Next click the Add button to move the styles to the Include Paragraph Styles list.

InDesign automatically increments the Level numbers for each additional style included (up to 10 levels).

For each style listed set the correct level. As the ChapterTitle can appear in either Black or White I’ll set both to “Level 1″ in this example.

085-081

Now let’s go back to the list of questions we asked ourselves when designing the look of the Table of Contents.

  • We created a Paragraph style called TOC_Level1 to format the Table of Contents Entries
  • We decided to have the page number After the Entry and to enter a Right-Indent Tab between the Entry and the PageNumber.

Select each of the Included Paragraph Styles and set its settings for Entry Style, Page Number and Between Entry and Number

085-091

We’re almost done now…

When it comes to creating our Interactive PDF with interactive Table of Contents and PDF Bookmarks, we must enable the Create PDF Bookmarks option.  Yep… you’re right… all this hard work and all we need to do is click this one button to get some extra interactivity in our PDF? Well kinda… we’ll still have create our Table of Contents in the document :-)

085-10

Click OK twice to add the Table of Contents Style to the InDesign document.

Step 4: Create a Table of Contents

Yay. Finally… we’re going to see our Table of Contents appear in the document.

Choose Layout > Table of Contents, and in the dialog select TOC Style created earlier in this example “Newsletter TOC” created and click OK.

The loaded text cursor appears containing all of the Table of Contents text. Click in the Table of Contents frame placed on the document page earlier or simply place the text wherever it needs placing.

085-22

And… ta da… There it is…

085-12

We’re now ready to test this rollover effect in the interactive PDF.

Creating the PDF

Choose a File > Adobe PDF Presets and select a PDF setting from the list of settings. Alternatively choose File > Export and set Format to PDF.

81-14

In the General section of the Export Adobe PDF dialog ensure the Bookmarks option is enabled for inclusion. Next click Export and generate the PDF.




This Post Has 28 Comments

  1. Spa services were once thought to cater only
    to women. Many customer reviews says that their delivery time is fast and they are not
    disappointed about the products. Mainly because they’ve gotten better results
    with little or no side effects.

  2. They can examine yokur present hosting needs and either recommend a hosting plan or create a custom one
    forr the web site. Computers that access the web pages are called web clients and the
    program that enable a web client to perform its duty are regarded as web browsers.
    This company offers five packages for youu to choose from.

  3. In addition, people with asthma are especially sensitive to salicylates.
    Remember to be inline together with your local department of revenue & department of
    business regulations. Different forms of Kratom
    are now widely used as a stimulant, pain reliever, sedative, and anti depressant.

  4. Hi there colleagues, how is all, and what you wish for to
    say on the topic of this article, in my view
    its in fact remarkable in support of me.

  5. I constantly spent my half an hour to read this website’s content daily along with a
    cup of coffee.

  6. biotin says:

    It’s very effortless to find out any topic on net as compared to textbooks,
    as I found this post at this site.

  7. Ardal Powell says:

    “The page-numbers that are generated as part of an InDesign index become hyperlinks in the generated PDF that link back to the page in the document.”

    They do not. Thwe instructions given above do not work.

  8. Cari Jansen says:

    @Arnold

    The page-numbers that are generated as part of an InDesign index become hyperlinks in the generated PDF that link back to the page in the document.

    You shouldn’t have to do this manually in Acrobat Pro. Do you have the “Hyperlinks” checkbox selected in the “Include” section of the “Export Adobe PDF” dialog?

  9. Part of my job is formatting two 400 pg course catalogs for Embry-Riddle. We include a substantial index which Indesign generates. We have been adding links to the referenced pages in Acrobat Pro making the index interactive. It is time consuming and has to be done over when a new index is generated. Uuug. Is there a way or plugin or something that would auto generate links to the referenced pages in Indesign when the index is created?

  10. Cari Jansen says:

    @Hannah you’re most welcome. Glad my blog-post was of help.

  11. Hannah says:

    Thank you!! I have looked through so many guides and tutorials on this topic and couldn’t find what I was missing until now. Your screencaps are extremely helpful!

  12. Mai says:

    Hi Cari, thank you so much for this tutorial. I used InDesign CS4, it helped me a lot to make my portfolio in .PDF
    here’s my finished work (it’s a heavy file 17 MB, sorry but I don’t know how to compress it more) :/

    http://maishakr.com/portafolio2011.pdf
    greetings!

  13. Christopher says:

    Cari,

    My questions are about rollovers. Once I create my toc, is there a way to make a rollover effect other than the “hand” either in InDesign or in Acrobat?

    Also, once the user clicks on an item, can the rollover effect “stick” till another link is selected? Can this be done without creating a button for each link?

    Thanks,

    Chris

  14. Cari Jansen says:

    @Gary

    If I’m understanding you correctly you are editing the Generated TOC text. This will out-date the TOC, making it invalid.

    If you want to use a custom-written TOC and create bookmarks for it as well, then you’ll have to look at creating hyperlinks from the new TOC text to page-references, as well as add Bookmarks in InDesign manually.

    Cari

  15. Gary says:

    Cari,

    My bookmarks are used as hyperlinks in the final PDF so when you click on the text in the TOC on the pdf page you jump to the anchor text page. The only problem is when I edit the text in the TOC to be more general than the anchor text was, I loose the hyperlink in the PDF. When I try to assign a hyperlink and anchor to the new text I have typed in InDesign the hyperlink panel grays out the “create new hyperlink option. Do I need to create a work around or am i missing something?

  16. Cari Jansen says:

    @Doug

    It depends a little on what your source files are.

    If the instruction manual is already a PDF, then you can use Adobe Acrobat to build links for your Table of Contents. If there is no TOC in the PDF, you can add an extra page to the PDF as well and add the links.

    If it is an InDesign file, you could ask a designer or InDesign user to build dynamic table of contents and export the PDF for you WITH hyperlinks & bookmarks enabled and you’d be done :-)

    If you plan to do more work and expect to be producing publications more often, then definitely look into purchasing InDesign and do a quick start training course in it as well.

    Hope this helps,

    Cari

  17. Doug says:

    If I want to copy an instruction manual with table of contents (with permission) with the ability to click on a subject in the table of contents to access that particular section and make it a DVD for sale then I have to purchase the InDesign program?

  18. Cari Jansen says:

    @JT. I’d probably need to see the document. But it sounds like you might need to introduce an additional paragraph style for that short title? and in the TOC Style set the settings for TOC formatting?

  19. Joanne says:

    Hei!
    This is great to find some info about interactive pdfs! We have discovered another little (annoying) problem I wonder if you have any tips about. We can’t seem to make a short chapter title and maintain formatting on the TOC in Indesign, even though all our styles are in order. I don’t think it shows on the pdf in the bookmarks, but some of our bookmarks do not maintain formatting in the pdf either. Its just a small thing, it just doesn’t look nice or professional when you miss the formatting. Function is still there though. Tips would b greatly appreciated!
    JT

  20. Cari Jansen says:

    Hi Rikka,

    Yep you can most certainly achieve that…

    but… you’ll have to break-up your chapters into individual documents, and define a new TOC-Style for the Chapter Level TOCs.

    Now for the overall TOC, you’d need to ensure you place all the chapters in a ‘Book’ using InDesign’s Book Feature, and re-define the overall TOC Style to ‘include Book Documents’

    Hope this helps.

    Cheers,

    Cari

  21. Riikka says:

    Hi Cari, it was really worth using styles consistently since the beginning of the project, as one tick box did the trick!

    Now I’m wondering is it possible to create ‘sub-table of contents’ under each chapter? Say, I need to add a sub-TOC to chapter 3, containing links to chapter 3 headings alone. It seems to me that InDesign 4 allows only one TOC per document.

  22. Allison says:

    What are the pros and cons of automatically generating a TOC?

    I’ve always created them manually, it would be nice to have the TOC automatically update when corrections are made that shift the page numbers. It would save a lot of time.

    I’ve followed this tutorial, but it seems like automatically generating a TOC is good for a simple TOC with only chapter titles and page numbers.

    Let me know your thoughts.

    • Cari Jansen says:

      Hi Allison,

      The TOC doesn’t automatically/dynamically update if you make changes in your document, however you CAN trigger the update through a command.

      To test this, change some of the headings throughout your text that use paragraph styles for which the Table of Contents text is filtered out into the TOC.

      Then to update your TOC, place your cursor anywhere in the current TOC , and choose Layout > Update Table of Contents. … and the changes made in your document will come through in your TOC :-)

      I’d always run an Update Table of Contents as one of the last things you do in your documents, to ensure that both pagenumber references and text is correct and up to date. That IS the advantage + creating the TOC this way is heaps faster :-)

      Cheers,

      Cari

  23. Heather Bauer says:

    Can you tell me how to change the sort order of a table of contents further than just alphabetically. I am creating a product catalog with a TOC for part numbers and below is a sample of the order it currently generates:

    04-601-68
    5F-220-x5
    5F-220-x8
    6A-272-xA
    6S-220-xB
    07-021-08
    07-022-12
    7A-421-03
    7A-621-03
    09-026-02

    It seems like InDesign ignores the numerical “0″ to generate its order. I want it to generate this order instead:

    04-601-68
    07-021-08
    07-022-12
    09-026-02
    5F-220-x5
    5F-220-x8
    6A-272-xA
    6S-220-xB
    7A-421-03
    7A-621-03

    My actual TOC is too lengthy to make these adjustments manually each time I make an edit or change the page ordering, etc. Can you help?

    • Cari Jansen says:

      Hi Heather,

      What an interesting find. I just ran a little test I reckon you are right. Something not quite right there. I’ve reported this one to Adobe, as I tend to agree with you on this one, that it isn’t behaving the way it should.

      Luckily there is a way in which you can sort the paragraphs correctly without having to do things manually :-)

      One of the scripts that comes pre-installed with InDesign is the “SortParagraphs” script. Highlight the text of your TOC and run the script from the Scripts panel (Application > Samples > Javascript > lists all scripts) and it will sort as expected.

      I tested on your sample and got the following result:
      04-601-68
      07-021-08
      07-022-12
      09-026-02
      5F-220-x5
      5F-220-x8
      6A-272-xA
      6S-220-xB
      7A-421-03
      7A-621-03

  24. Cari Jansen says:

    You’re most welcome :-)

  25. Marco says:

    What a great read! Thank you for sharing.

Leave A Reply