I wanted to make a page to automate the creation of a table of contents, table of pictures, and table of listings (Our document uses a custom paging convention that counts per chapter, so Google's own ToC is unusable). The problem is: after I get the paragraph, I can't get the page where the paragraph is on. This question: How to get the number of pages in Google Docs via Google script? implies that I have to somehow get my hands dirty on pdf blobs.
So, the question is: given a paragraph, how do I find out the page number?