Col*_*ern 7 pdf pdf-generation google-sheets google-apps-script
我想知道如何将自定义页眉或页脚添加到使用Google Apps脚本从Google表格导出的PDF中。我想在页面中央添加一个页脚,写上“我的公司专有和机密”。
这是正常的从图纸导出PDF的功能(即,文件»下载为»PDF»页眉和页脚»编辑自定义字段),但是我不知道如何使用URL参数进行复制。我也尝试过设置'&sheetnames=true&printtitle=true',但这会将工作表名称和电子表格名称放在页眉而不是页脚中。
是否可以使用其他URL参数来控制这些自定义字段?
var url = 'https://docs.google.com/spreadsheets/d/'+sourceSpreadSheet.getId()
+'/export?exportFormat=pdf&format=pdf' // export as pdf / csv / xls / xlsx
+ '&size=letter' // paper size legal / letter / A4
+ '&portrait=false' // orientation, false for landscape
+ '&fitw=true' // fit to page width, false for actual size
+ '&sheetnames=false&printtitle=false' // hide optional headers and footers
+ '&pagenum=CENTER&gridlines=false' // hide page numbers and gridlines
+ '&fzr=false' // do not repeat row headers (frozen rows) on each page
+ '&gid='+sourceSheet.getSheetId() // the sheet's Id
+ '&top_margin=0.45&left_margin=0.25&right_margin=0.25&bottom_margin=0.5'; // margins
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
646 次 |
| 最近记录: |