I'm trying to write a script in google docs that can obtain the page number of a certain position on a page. Something that is similarly done with the Table of Contents feature. However, I haven't found a specific function that could help me obtain the page number. Is there a function or a workaround I can use/implement to get the page number of a certain element on a page?
I've looked at previous questions in stack overflow, but most of their answers are from 2012.