How to Add Numbering to a PDF Table of Contents Using DDX
Question details
The user needs to format a PDF table of contents during document assembly so that each entry includes an automatically incremented number (e.g., 1, 2, 3) using Adobe DDX.

- Product
- Adobe DDX
- Device & OS
- not provided
- Scenario
- Assembling documents and generating a structured PDF table of contents.
- Observed behavior
- The generated table of contents lacks numerical prefixes, and the user requires a way to implement automatic incrementing numbers for each entry.
Ensure you have access to your DDX XML configuration file and a compatible PDF assembly environment (like Adobe Experience Manager or LiveCycle) to test the generated output.
Configure DDX Table of Contents Numbering Syntax
Modify your DDX XML logic to include an automatically incremented numbering field before each table of contents entry.
Adobe Document Description XML (DDX) allows you to define the structure of assembled PDF documents, including automatically generated Tables of Contents (TOC). To add numbers, you must configure the TOC elements to use automatic list numbering attributes.
Access your project directory and open the target DDX XML file using a text or XML editor of your choice.
Find the <TableOfContents> or <TOC> tag block within your DDX file where the document assembly and styling logic are defined.
Add or modify the entry styling attributes to include automatic numbering. Depending on your DDX version, utilize the built-in list numbering syntax or prefix variables (e.g., setting list-style-type for the TOC entries).
Run your PDF assembly process to generate the final document. Open the generated PDF and verify that the table of contents entries correctly display sequential numbering like 1, 2, and 3.

Easily Create Numbered PDF Table of Contents with WPS Office
Skip the complex XML coding and DDX configurations. With WPS Office, you can effortlessly generate perfectly numbered Table of Contents using a visual word processing interface and export it directly to a professional PDF.
- 1. Structure Your Document: Open WPS Writer and apply standard 'Heading 1', 'Heading 2', etc., to your chapter titles.
- 2. Insert a Numbered Table of Contents: Navigate to the 'References' tab, click 'Table of Contents', and select a format that includes automatic numbering.
- 3. Export to PDF: Click 'Menu' in the top-left corner, select 'Export to PDF', and save your document. The PDF will retain the perfectly formatted, numbered table of contents.

Frequently Asked Questions
Can I manually edit the table of contents numbers after the PDF is generated?
Once a PDF is assembled via DDX, the content becomes static. While you can use a PDF editor like WPS PDF to alter text blocks manually, it is highly recommended to correct the numbering logic in the DDX source file and regenerate the document.
Why are my DDX table of contents numbers not incrementing?
This typically occurs if the numbering variable or list style isn't scoped correctly within the repeating TOC entry loop in your XML structure. Verify that the incrementing counter is placed inside the repeating entry tag, rather than outside of it.
Can I create a PDF table of contents without writing XML code?
Yes. Instead of using DDX for enterprise document assembly, individual users can use word processors like WPS Writer to visually format a document with a numbered TOC, and then simply export it directly to a PDF file.




