有没有一种方法可以将页脚添加到从电子表格生成的pdf中?

时间:2018-08-15 14:26:20

标签: javascript google-apps-script google-sheets

我想知道如果可能的话,需要添加什么以在下面的生成的附件中插入页脚?

function onOpen() {
  var submenu = [{name:"TEST", functionName:"testRun"}];   
  SpreadsheetApp.getActiveSpreadsheet().addMenu('RUN', submenu); 
}

function testRun(){
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var docName = "Document 1";
  var emailTo = "notmyactualemail@something.co.uk";
  var emailSubject = "Doc 1";
  var emailBody = "Placeholder";

  // Make the PDF
  var pdf = DriveApp.getFileById(ss.getId()).getAs('application/pdf').getBytes();
  var attach = {fileName:docName, content:pdf, mimeType:'application/pdf'};

  // Send the freshly constructed email 
  MailApp.sendEmail(emailTo, emailSubject, emailBody, {attachments:[attach]}); 
}

如果不能,则可以减少页边距,以便将更多行容纳在单个页面上?

非常感谢您。

0 个答案:

没有答案