Skip to content

TOC Update

When a document contains a Table of Contents (TOC) field, Cloud Document Maker can automatically update it after the document is generated.

How It Works

  1. Detection: After the document is rendered and saved, the system checks if it contains a TOC field
  2. Update: If a TOC is found, the document is sent to Aspose.Words Cloud API to update all fields (including TOC)
  3. Save: The updated document replaces the original

Configuration

To enable TOC updates, set the following environment variables:

VariableDescription
DOCX_POST_PROCESSOR_METHODSet to Aspose to enable TOC updates
ASPOSE_CLIENT_IDYour Aspose.Words Cloud Client ID
ASPOSE_CLIENT_SECRETYour Aspose.Words Cloud Client Secret
ASPOSE_TIMEOUTTimeout in seconds (default: 1800 = 30 minutes)

Getting Aspose Credentials

  1. Create an account at Aspose Cloud Dashboard
  2. Create a new application to get your Client ID and Client Secret
  3. Add these credentials to your .env file

Notes

  • TOC update only runs if the document contains a TOC field
  • Processing time depends on document size (larger documents take longer)
  • If TOC update fails, the document is still saved but with a warning logged
  • The timeout should be set based on your largest expected document size