2

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?

Xwtek
  • 1,151
  • 1
  • 9
  • 19
  • From what was provided, it almost sounds like the solution would be as simple as implementing a numbered list. This question otherwise duplicates many others on here with the ultimate resolution being, there is currently no method to pull page numbers directly using Google Apps Script. That being said, there are plenty of other workarounds (as mentioned in other responses). I am still not sure though if any of these would even be necessary, as the implementation details still seem sparse for this question. –  Jul 05 '21 at 09:07
  • Like I-1, I-2, I-3, .... II-1, II-2, II-3, ,,,, III-1. – Xwtek Jul 05 '21 at 10:22
  • 1
    Google-doc is a clumsy cross between html and ms-word formats. It considers the concept of pages and page numbers (and page sizes, btw) as a rather legacy and ephemeral thing. Not like the pdf format, which is a successor of the glorious paper era when a page, page size and page numbers were an intrinsic properties of the every printable element. So, yep, probably you have to get your hands dirty with pdf blobs, etc. For now, at least. – Yuri Khristich Jul 04 '21 at 15:34

0 Answers0