The page numbers in the TOC and in cross-references are resolved by PDFreactor at layout time via target-counter(attr(href), page) — add a chapter and watch every reference renumber itself. TOC entries and cross-references are real hyperlinks in the PDF; bookmarks appear in the viewer's navigation pane (toggle maps to disableBookmarks).
Example configuration (updates live as you use the demo — POST to https://cloud.pdfreactor.com/service/rest/convert.pdf):
{
"document": "<html><head><style>.toc a::after { content: leader(dotted) ' ' target-counter(attr(href), page) } .chapter { page-break-before: always }</style></head><body><nav class='toc'><a href='#ch1'>Chapter One</a></nav><section class='chapter' id='ch1'><h1>Chapter One</h1>…</section></body></html>"
}