简体   繁体   English

如何使用Google Apps脚本在文档中添加页码

[英]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. 我想使用Google Apps脚本将页码和总页数添加到文档页脚中。

I can't find the api for it. 我找不到它的api。 Is it possible? 可能吗?

据我所知,没有办法处理GAS中的页码,这个问题有一个问题,如果有什么变化的话,你可以通过它来保持通知...并顺便投票给它;-)

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. 正如Serge已经提到的,现在不可能以编程方式从GAS插入页码和/或页数,但是通过在编辑器中创建文档,通过单击页面将页码插入页脚,可以解决此问题。 Insert->Page number->Bottom of page菜单项,保存文档并在脚本中将此文档的副本用作模板。 The File.makeCopy method services to make a copy of the template. File.makeCopy方法用于制作模板的副本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM