any help would be greatly appreciated. I use the below code successfully to automatically send an email using triggers daily that turns the attached Google Sheet into a .PDF and emails it to a list of recipients. I am having difficulty in setting the parameter to landscape instead of portrait.
Thank you for your help in advance.
// START
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu("Sender-Thingy")
.addItem("Send", "send")
.addToUi();
};
function send() {
var ss = SpreadsheetApp.getActive();
var email = "email@gmail.com";
var subject = "New PRT Daily Report: 09/02/2016";
var body = "Please find attached your PRT Daily Report.";
MailApp.sendEmail(email, subject, body, {
attachments: [{
fileName: ss.getName() + ".pdf",
content: ss.getAs("application/pdf").getBytes(),
mimeType: "application/pdf"
}]
});
};
// END
By using a URL to build the PDF instead, you can specify if it's landscape or not.
Then email it to wherever it needs to go, using what you have already
Something like this, bear in mind this script needs you to edit a few bits and only exports a single page, it can do more pages if you needed it to.
This is untested