Change document orientation when exporting to PDF

Viewed 2078

I have this script that emails the content of a speadsheet to all the collaborators on a regular basis.

function myFunction() {
  var document = SpreadsheetApp.openById("123documentid456");

  var editors = document.getEditors();
  for(var i = 0; i < editors.length; i++){
    MailApp.sendEmail(editors[i].getEmail(), "Subject", "Some message", {
      attachments : [document.getAs(MimeType.PDF)]
    });
  }
}

It creates a PDF and emails it. The thing is the content does not display nicely as the PDF's orientation is portrait. Is there any way to make it export to landscape?

1 Answers
Related