EDIT: I FIXED MY ISSUE It turns out it was pulling the function from another .gs file I had as a backup, that I never commented out. Its always the simple things.
I had a Script that I modified and worked well found here but it didn't have any functionality to hide gridlines.
I spent a few hours searching and found this which works really well, but it exports the entire document and not just the individual sheet I need. What do I need to do to get it to export just the first sheet?
//global
var SS = SpreadsheetApp.getActiveSpreadsheet();
var Invoice_Sheet = SS.getSheetByName("Private Invoice");
function generatePdf() {
// Get folder containing spreadsheet, for later export
var parents = DriveApp.getFileById(SS.getId()).getParents();
if (parents.hasNext()) {
var folder = parents.next();
}
else {
folder = DriveApp.getRootFolder();
}
//additional parameters for exporting the sheet as a pdf
var url_ext = 'export?exportFormat=pdf&format=pdf' //export as pdf
// following parameters are optional...
+ '&size=A4' // paper size
+ '&portrait=true' // orientation, false for landscape
+ '&fitw=true' // fit to width, false for actual size
+ '&sheetnames=false&printtitle=false&pagenumbers=false' //hide optional headers and footers
+ '&gridlines=false' // hide gridlines
+ '&fzr=false' // do not repeat row headers (frozen rows) on each page
+ '&gid=0'; //first page
var options = {
headers: {
'Authorization': 'Bearer ' + ScriptApp.getOAuthToken()
}
}
var Name = Invoice_Sheet.getRange("C12").getValue();
var curDate = Utilities.formatDate(new Date(), "GMT+1", "dd/MM/yyyy")
var pdfName = Name + " - " + curDate + " - " + "Suds Invoice";
var response = UrlFetchApp.fetch("https://docs.google.com/spreadsheets/" + url_ext, options);
var blob = response.getBlob().setName(pdfName + '.pdf');
folder.createFile(blob);
}