user1628025
user1628025

Reputation: 51

How to add page number in a document using Google Apps Script

I would like to add page number and total number of pages into the document footer using Google Apps Script.

I can't find the api for it. Is it possible?

Upvotes: 5

Views: 4696

Answers (2)

megabyte1024
megabyte1024

Reputation: 8660

As Serge already mentioned, now there is no possibility to insert a page number and/or a page count programmatically from a GAS, but there is a workaround by creating a document, in the Editor, inserting a page number to the footer by clicking the Insert->Page number->Bottom of page menu item, saving the document and using a copy of this document as a template in the script. The File.makeCopy method services to make a copy of the template.

Upvotes: 5

Serge insas
Serge insas

Reputation: 46794

As far as I know there is no way to handle page numbers in GAS, there is an issue on that subject, You could star it to keep informed if something changes... and kind of vote for it by the way ;-)

Upvotes: 4

Related Questions