Repeat a header and footer on every page, and print page numbers.
page.header and page.footer are nodes that repeat on every page — at the top and bottom respectively. Both are optional, and each is an ordinary node, so anything you can put in the body goes there too.
The body flows between them. On a multi-page document the header and footer are redrawn on each page, and the content area shrinks to leave room — you don’t position them yourself.
Page numbers come from a richText node using the pageNumber and totalPages spans. Put it in the footer (or header) so it repeats and resolves per page:
That renders Page 1 of 3, Page 2 of 3, and so on. pageNumber and totalPages are filled in by the renderer — they’re the only dynamic values that don’t come from your data.
Page-number spans only do something useful where the node repeats. In page.content they’d render a single time on the first page. Keep them in header or footer.