I'm building a custom print template closely following the directions in Chuck Ainslie's articles. One thing I'd like to do is generate a table of contents on the fly with the actual page numbers.
Is there any way too find what part of the document a layoutrect instance contains? Basically, I want to scan the original document for specific tags (say <h1> tags), then figure out which layoutrect contains those tags. From there I can figure out which devicerect is the parent and that tells me the page number.
During the layout, when the onLayoutComplete handler is called, there doesn't seem to be any way to get the source of what was actually laid out.