Overview
TOC Builder generates a professional Table of Contents page (or pages) inside a PDF document by reading the existing bookmark hierarchy and rendering each bookmark as a formatted TOC entry with title, dot leaders, and page number. The plug-in can produce a TOC for a single document, regenerate one in many documents at once, or build a single master PDF whose TOC links to entries spread across several source files.
TOC Builder is designed to work alongside the Bookmarker component. Build a clean bookmark tree first, then use TOC Builder to render it as a presentable TOC.
Menu location
By default, TOC Builder commands appear directly under the Plug-Ins menu. If you prefer them grouped under a Plug-Ins > Mapsoft submenu, enable Place under Mapsoft menu in Plug-Ins > Mapsoft Preferences. Acrobat must be restarted for the change to take effect.
Before you start
A few things to confirm before generating a TOC:
- Bookmark hierarchy — the TOC mirrors the bookmark tree. Any mis-nested, blank, or out-of-order bookmark will appear that way in the TOC. Use Sort Bookmarks, Set Expansion, and the bookmark validation tools first.
- Page numbers — TOC page numbers are counted from the pages themselves: the page after the TOC gets the Page after TOC is number and later pages count on from it. Acrobat page labels are not used; for Roman or letter numbering, choose the numbering type of each level in the level editor.
- Bookmarks that don’t point to pages — menu items, JavaScript actions, or named-destination bookmarks can be excluded automatically (see TOC Numbering Options).
- Insertion point — decide whether the TOC sits before or after a specific page, and what number the page after the TOC should have.
Quick start
The fastest path from a bookmarked PDF to a finished TOC:
- Open the PDF in Acrobat. Confirm the bookmark tree is correct.
- Choose Plug-Ins > TOC > TOC Builder... (or press Ctrl+Shift+1). The TOC Builder dialog opens on the Mapsoft TOCBuilder tab.
- Choose Blank Page in the TOC pages group (the simplest start). Set Based on Page to the page number you want the TOC to size itself to.
- In the Levels group, click Add Level for each bookmark depth you want to include (Level 1 for top-level bookmarks, Level 2 for their children, and so on). Configure font, size, indent, and leader style per level.
- In TOC Numbering Options, use Position and page to choose where the TOC is inserted, and Page after TOC is number for the number of the page that follows it.
- (Optional) Switch to the Header/Footer tab to add running headers/footers to the TOC pages.
- Click Apply. TOC Builder renders the TOC, inserts the new pages, and shows the result in the open document. Save the PDF to keep the changes.
Tip
Save your settings as a named configuration once they look right (see Saving and reusing configurations). The next document only needs you to load the configuration and click Apply.
The TOC Builder dialog
The dialog is a property sheet with three tabs across the top. Settings on every tab are committed together when you click Apply or Apply to File List at the bottom of the window. Switching tabs does not lose your inputs.
| Tab | Purpose |
|---|---|
| Mapsoft TOCBuilder | The main TOC settings — how the TOC looks, where it goes in the document, and which bookmarks it includes. |
| Header / Footer | Optional running header and footer text on the generated TOC pages, with independent settings for each. |
| Files | Multi-file processing — build the same TOC into many PDFs in one run, or generate a master TOC PDF that links across them. |
Tab 1 — Mapsoft TOCBuilder
This is where most of the work happens. The tab is divided into eight groups; each group is documented below in the order it appears in the dialog.
TOC pages
Choose how the TOC pages themselves are created.
| Control | Description |
|---|---|
| Template File (radio) | Use an existing PDF as the basis for the TOC pages. Useful when you have a designed cover/letterhead PDF and want the TOC rendered onto it. The template must be a different file from the document you are adding the TOC to — the dialog checks this (including network paths) when you apply. If the template is password-protected, an Enter Password prompt asks for its password when the TOC is built (batch runs do not ask). |
| Browse… | Locate the template PDF on disk. |
| Blank Page (radio) | Create plain TOC pages from scratch. |
| Based on Page | Page whose size (media box) the blank TOC pages copy. Page rotation is not copied. |
Units
The Units combo (top-right of the tab) controls the unit of measurement for every margin and position field on this tab — inches, centimetres or points. Switching units re-displays the existing values in the new unit; it does not reset them.
Page Margins
Margins applied to the TOC body content (excluding the title block).
| Control | Description |
|---|---|
| Later pages top | Distance from the top of the second and later TOC pages to the first entry. |
| Top | Distance from the top of the first TOC page (the one with the title) to the first entry. Make it larger than the title’s Top in Contents Title, by at least the entry font size, so the entries start below the title. When the title wraps, add 1.5 times the title size for each extra line. |
| Left / Right / Bottom | Margins of every TOC page. The TOC body is laid out within these margins. Each entry starts 25 pt (about 0.35 in or 9 mm) inside the Left margin, plus its level’s Indent, and the entries’ page numbers end 50 pt (about 0.7 in or 18 mm) inside the Right margin. |
Contents Title
The heading that appears at the top of the TOC’s first page.
| Control | Description |
|---|---|
| Text | The title text itself (e.g. Table of Contents). |
| Insert (combo) | Inserts a dynamic placeholder (such as the file name) into the title text at the cursor. With Apply to File List, the file name and path are those of each listed file or, for a master PDF, of the file the master is saved as. |
| Font | Font family used for the title. Names in red are the 14 standard PDF fonts; the others are fonts installed on this computer. If saved settings name a font that this computer does not have (a configuration made on another computer, say), the font is kept, listed last, so the settings do not change when you save them; another font is used in its place when the TOC is built on this computer. |
| Size | Title font size in points. |
| Top / Left | Where the title sits: Top is the distance from the top of the page down to the title’s baseline, and Left the distance from the left edge of the page to the start of the title. They are positions, not margins, and are separate from the body margins above. |
| Right margin | Space kept clear between the title and the right edge of the page. A title too long for one line wraps onto as many lines as it needs, each starting at Left and 1.5 times the title size below the line before. Make the first page’s Top (under Page Margins) large enough to keep the entries below the title’s last line. |
| Color | Title text colour. Click the swatch to open a colour picker. |
| Also add as bookmark | Add a bookmark to the document that points to the TOC’s title page. Recommended — lets readers jump back to the TOC from anywhere. |
Levels
The Levels list defines the formatting for each depth of bookmark you want rendered in the TOC. Level 1 is for top-level bookmarks, Level 2 for their immediate children, and so on. Bookmarks deeper than the deepest level you have defined are not rendered.
| Control | Description |
|---|---|
| Levels list | Tree showing the levels you have defined. Selecting a level shows its current settings in the panel to the right. |
| Add Level | Add a new level. Opens the level editor, where you set font, size, colour, leader style, indent, and other per-level options. |
| Edit Level | Edit the selected level’s settings. Double-clicking a level in the list does the same thing. |
| Remove Level | Delete the selected level. If there are levels below it, you are asked first: they move up one place (Level 3 becomes Level 2, and so on), so the bookmarks the removed level formatted take the settings of the level below it, and the deepest bookmarks no longer appear in the TOC. Removing the deepest level leaves its own bookmarks out of the TOC, without asking. |
| Remove All | Clear every level from the list. You will need to add at least one before you can generate a TOC. |
Tip
The summary panel to the right of the list shows the selected level’s key settings at a glance: Content Color, Link Line Width (and Link Color, when a border is drawn), Font Name, Font Size, Line Spacing, Indent, Page Number Width, Wrap Width, Wrap Indent and Page Numbers, followed by Numbering and Leaders when page numbers are shown.
The level editor
Add Level and Edit Level open the level editor; its title bar shows which level you are editing (for example Edit Level 2). Indents and widths are in the units chosen in Units; font size and line spacing are in points.
| Control | Description |
|---|---|
| Font | Font used for this level’s entries. Names in red are the 14 standard PDF fonts; the others are fonts installed on this computer. If the level names a font that this computer does not have (a configuration made on another computer, say), the font is kept, listed last, so clicking OK does not replace it; another font is used in its place when the TOC is built on this computer. |
| Size | Font size of this level’s entries, in points. |
| Line Spacing | Extra space between lines at this level, in points, added to the font size (0 = no extra space). |
| Indent | How far this level’s entries are indented, in addition to the fixed 25 pt (about 0.35 in or 9 mm) inset every entry has from the left margin. A negative value moves the entries to the left. |
| Color (Font Attributes) | Colour of the entry text. Click the swatch to open a colour picker. |
| Page num width | Width kept for the page number at the end of each entry. Leave it blank for an automatic width. |
| Wrap width | Longest line an entry may use before it wraps or is truncated (see Long Bookmark Handling). Leave it blank to use the full width between the margins. |
| Include destination page numbering | Show the number of the page each entry points to. The leader, numbering type and page-number width are used only while this is ticked. |
| Include Leaders (and the style list) | Fill the space between the entry text and its page number with a leader: dashes, large or small dots (close or spaced), a solid line, or Full stops (text) (named Periods (text) where Windows is set to the United States, Canada or the Philippines). The first six are drawn as graphics, at a fixed size. The text style, last in the list and the default for a new level, is made of real full stop (period) characters in the level’s own font, size and colour: the dots grow and shrink with the font, line up from one entry to the next within a level, and are part of the page’s text, so a copied or searched entry reads Title ........ 7. The style list is available only while Include Leaders is ticked. |
| Numbering type | How this level’s page numbers are written: 1, 2, 3; I, II, III; i, ii, iii; A, B, C; or a, b, c. |
| Line width (Links) | Border drawn around each entry’s link area: None, Thin, Medium or Thick. None draws no border. |
| Color (Links) | Colour of that border. Available only when Line width is not None. |
| Wrap indent | Hanging indent of the continuation lines of a wrapped entry. Leave it blank for an automatic indent of roughly twice the font size. |
| Preview | A sample line for each level up to the one you are editing, which is in full colour while the others are faded. When the lines do not all fit, the first levels are left out so that the level you are editing still shows. |
TOC Numbering Options
Where the TOC sits in the document and how page numbering interacts with it.
| Control | Description |
|---|---|
| Page after TOC is number | The number the TOC shows for the first page after the TOC; later pages count on from it. Where the TOC goes is set by Position and page. The default is 1, so the contents pages themselves are not counted: with the TOC at the front, each entry shows the number its page had before the contents pages were inserted. That number is lower than the page position Acrobat shows by the number of contents pages (with a one-page TOC, the page Acrobat calls 3 is listed as 2). The links in the TOC go to the right page either way. To list the positions Acrobat shows instead, enter the number of contents pages plus one (2 for a one-page TOC). Pages in front of the TOC are always listed by their position in the document. |
| Position (Before / After) | Whether to insert the TOC before or after the page specified in page. |
| page | The reference page for the position. Combined with the Position selector, this places the TOC at a specific location. |
| Restart page numbering | Number each entry’s page from the start of its chapter: every top-level bookmark starts a chapter whose first page is 1. While it (or chapter numbering) is ticked, Page after TOC is number is not used and is greyed. |
| Show chapter numbering starting at | Display chapter numbers in the TOC entries beginning with the given value. Useful for documents organised by chapter. |
| Exclude bookmarks that don’t point to pages | Skip bookmarks whose action is not a Go-To-Page (e.g. JavaScript actions, named destinations without page anchors). Recommended for clean TOCs. |
| Create thumbnails for new pages | Generate Acrobat page thumbnails for the new TOC pages so they show up in the Acrobat thumbnails panel. |
Long Bookmark Handling
How TOC Builder copes with bookmark titles that don’t fit on one line.
| Control | Description |
|---|---|
| Wrap long bookmarks onto multiple lines | Long entries flow onto a second (and third) line within the same TOC entry. Continuation lines are indented under the first line (a “hanging indent”) so the entry reads as one block, and the leader dots and page number stay on the last line. Default. |
| Truncate long bookmarks if they don’t fit | Cut the title at the available width. Enables the two truncation sub-options below. |
| Truncate at word boundary | When truncating, cut at the last whole word that fits, rather than mid-word. |
| Use ellipsis (…) at end | Append an ellipsis to truncated titles so readers know the title was shortened. |
How far the continuation lines are indented is controlled per level by the Wrap indent field in the level editor (Levels > Edit Level > Wrapping). Enter the indent in the same units as the rest of the dialog (inches, centimetres or points); leave it blank to use an automatic indent of roughly twice the level’s font size. Because it is a per-level setting, deeper levels can use a smaller hanging indent than top-level entries if you prefer.
Configurations
See Saving and reusing configurations below — the same controls (Name, Save, Delete, Set as default) appear at the bottom of this tab and are shared across the whole dialog.
Tab 3 — Files
Process many PDFs at once: either add a TOC into each one independently, or generate a single master PDF whose entries link to bookmarks in the source files.
Files to process
| Control | Description |
|---|---|
| File list | The PDFs that will receive table-of-contents processing. Three columns are shown: File Name, Bookmarks (count), and File Path. A ? in the Bookmarks column means the file could not be opened. |
| Refresh Bookmarks | Count the bookmarks in every listed PDF again. A ? means the file could not be opened. |
| Remove Files Without Bookmarks | Remove from the list the PDFs whose Bookmarks count is 0. The files themselves are not changed, and files that could not be opened are kept and listed in a message. |
| Help | Open this part of the user guide. |
| Add File… | Add one PDF to the list (open-file dialog). To add several at once, use Add Folder… or drag PDFs onto the list. |
| Delete | Remove the selected files from the list. The files themselves are not deleted. |
| Delete All | Clear the entire list. |
| Save List… | Save the current list of PDFs to a text file. Useful for re-running the same job later. |
| Load List… | Load a previously-saved list of PDFs from disk. |
| Add Folder… | Add every PDF in a chosen folder. Subfolders are not searched, and PDFs already on the list are skipped. |
| Move Up / Move Down | Move the selected files up or down in the list. Order matters for master mode — entries are added in list order. |
The Move Up, Move Down, Delete, and Delete All commands are also available on the file list's right-click menu, and files can be reordered by dragging them within the list.
Table of Contents Output
| Control | Description |
|---|---|
| Generate table of contents in each file | For every PDF in the list, render the TOC inline using the settings on Tab 1, then save the file in place. You are asked to confirm first, with the number of files that will be changed. A file that is open in Acrobat is skipped (so its unsaved edits are not saved for you) and listed in the summary; use Apply on it instead. |
| Create master PDF table of contents | Build a single new PDF whose bookmark tree links to every bookmark in every source file. Source PDFs are not modified. |
| Master PDF output | File path for the generated master PDF. It starts empty; if it is still empty when you click Apply to File List, you are asked where to save the master PDF. |
| Browse… | Choose where the master TOC PDF will be saved. |
Warning
Generate table of contents in each file overwrites the source PDFs. Make a backup of any production files before running this on a long list.
Files with no bookmarks
PDFs that contain no bookmarks are skipped (a warning lists them). In master mode they contribute no entries; in per-file mode no TOC is generated for them.
Settings are checked once
The settings are checked once before the run starts. Problems with individual files (a file that cannot be opened, a “Based on page” the file does not have, and so on) do not stop the run: each is listed against its file in the summary at the end. A file already on the list is not added a second time.
Acrobat Protected Mode
With Protected Mode on, Acrobat does not let a plug-in open files you did not pick in its own dialog, such as the PDFs in a folder you added. TOC Builder works on a temporary copy of each listed file, made by the Mapsoft broker that is installed with it, and copies the result back. If the broker is missing or out of date, the summary says that Protected Mode blocked access to the file.
Saving and reusing configurations
The Configurations group at the bottom of the Mapsoft TOCBuilder tab lets you save the current settings (across all three tabs) as a named configuration and reload it later. This is the single most effective time-saver for repeat work.
| Control | Description |
|---|---|
| Name (combo) | The list of saved configurations. Pick one to load it; type a new name to save the current settings under that name. |
| Save | Save the current settings as a configuration with the chosen name. If the name already exists, you are asked before it is overwritten. A name can use any characters except a backslash (\). |
| Delete | Delete the selected configuration. |
| Set as default | Mark the selected configuration as the one that loads automatically the next time the dialog opens. |
Configurations are saved in the registry for your Windows user account.
Troubleshooting
| Problem | Solution |
|---|---|
| Missing entries in the TOC | Confirm you have a level defined for the bookmark depth at which the missing entries sit. Bookmarks deeper than the deepest level you have configured are not rendered. |
| Bookmarks pointing to JavaScript actions appear in the TOC | Tick Exclude bookmarks that don’t point to pages in TOC Numbering Options. |
| Page numbers in the TOC look wrong | Check Page after TOC is number (and Restart page numbering / Show chapter numbering starting at) in TOC Numbering Options, and each level’s Numbering type. TOC Builder counts the pages itself and does not read Acrobat’s page labels. |
| TOC pages spill across too many pages | Reduce the number of levels, lower font sizes, or increase the page size. The level summary panel shows the wrap width currently in use. |
| Long bookmark titles look ugly | Switch from Wrap to Truncate in Long Bookmark Handling, with Truncate at word boundary and Use ellipsis ticked. |
| Header or footer not appearing | On the Header/Footer tab, pick the Header or Footer tab and confirm that Include header text on TOC pages or Include footer text on TOC pages is ticked. The preview stays blank for a section that is switched off. If only the first TOC page lacks it, untick Skip on first TOC page. |
| Apply to File List did nothing | The Files tab list is empty, or every file in the list has zero bookmarks. Use Add File… or Add Folder… to populate the list, then re-run. |
| Source files were modified unexpectedly | Generate table of contents in each file writes back to the original PDFs. Use Create master PDF table of contents instead if you want the source files left alone. |
Tip — iterate quickly
On a representative document, save a configuration once you have settings that look right. From then on, run TOC Builder with that configuration loaded, click Apply, and review — far faster than reconfiguring each level by hand for every job.
See also
- Bookmarker User Guide — build the bookmark tree the TOC reads from
- Remove TOC — delete a table of contents TOC Builder made
- Sort Bookmarks
- Set Expansion
- Validate Bookmarks
- Create PDF