What I really want to achieve was to have proper page number at the bottom of each page, including the TOC pages.
This doesn’t seem to be possible, example code below:
var document = new Document();
var tocPage = document.Pages.Add();
tocPage.TocInfo = new TocInfo();
for (var i = 0; i < 50; i++)
var page = document.Pages.Add();
TocPage = tocPage,
DestinationPage = page,
Text = "page",
Margin = new MarginInfo(0, 20, 0, 20)
// Add page number stamp to every page in the document.
foreach (var page in document.Pages)
Is page numbering not supported for TOC pages at all?
You mentioned that counting all TOC pages as 1 single page is the default behaviour, and requested creating a different file with Adobe Acrobat with the desired result I wanted. However, not even Adobe Acrobat Pro DC has the feature of creating TOC, as discussed in this Adobe community thread: https://community.adobe.com/t5/acrobat-sdk-discussions/toc-in-adobe-acrobat-pro-dc/m-p/8386354.
Just quoting what the Adobe Community Professional said as why Acrobat doesn’t have the TOC feature built-in:
TOC is very basic task that any reasonably good content creator should be able to do. But Acrobat is a content distribution application so that after you have your content created you can distribute it safely into many many hands as a PDF.
Nonetheless, I have attached a PDF with TOC and proper page number at the bottom of each page as an example. This PDF was created in Microsoft Word: Contents.pdf (82.7 KB)