We are trying to generate a dynamic table of contents in Connect, however hadn’t find any solution for getting the number of pages for each Section used.
If anyone had a similar problem, and got to a solution, feel free to share it with us
I’ve only seen this done one way before and that’s usinga two-pass method.
So the issue at hand is that you need to know the page numbering to create your first page (the ToC) but the page numbering isn’t known by Connect until after the page content has been created. This leaves one option, really, generate a PDF and run that back into a second Connect process.
Now, the second process will have no concept of what a section is, so you’re going to have to hide some text on the page that the second process can read. This can be white text on a white background. The datamapper will be able to read it, but you won’t see it on output.
The general idea is that you’d tag each section with an ID (let’s just go AA through ZZ). So maybe page 1-3 are a section, so they’d go AA1, AA2, AA3. The next would be AB1,AB2, and so on. With those markers on the page, your datamapper would read in each document and with a little bit of logic, create a detail table based on the codes you’ve indicated. From that, you should be able to assign specific page numbers to each section and stamp them into a detail table on a page of the document that you left blank for the purpose.