Dynamic footer/header generation is not something that we support as part of the API, but it is under review. However, if you are using Adobe Document Generation API using a Word-based template, your page number and total page numbers are configured in your Word document which is then processed when the document is generated.