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
- Detection: After the document is rendered and saved, the system checks if it contains a TOC field
- Update: If a TOC is found, the document is sent to Aspose.Words Cloud API to update all fields (including TOC)
- Save: The updated document replaces the original
Configuration
To enable TOC updates, set the following environment variables:
| Variable | Description |
|---|---|
DOCX_POST_PROCESSOR_METHOD | Set to Aspose to enable TOC updates |
ASPOSE_CLIENT_ID | Your Aspose.Words Cloud Client ID |
ASPOSE_CLIENT_SECRET | Your Aspose.Words Cloud Client Secret |
ASPOSE_TIMEOUT | Timeout in seconds (default: 1800 = 30 minutes) |
Getting Aspose Credentials
- Create an account at Aspose Cloud Dashboard
- Create a new application to get your Client ID and Client Secret
- Add these credentials to your
.envfile
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