Skip to content

Instantly share code, notes, and snippets.

@Morecoffee
Morecoffee / Code.gs
Last active October 11, 2019 00:46 — forked from primaryobjects/Code.gs
Export a Google Drive spreadsheet to PDF in Google Drive in the same folder.
// Simple function to add a menu option to the spreadsheet "Export PDF", for
// saving a PDF of the spreadsheet directly to Google Drive.
// The exported file will be named with C5 content plus CompanyName variable plus B2
// plus the FileExt variable and saved in the same folder as the spreadsheet.
// To change the filename, just set pdfName inside generatePdf() to something else.
// Running this saves the sheet as a PDF document
function onOpen() {
var submenu = [{name:"Create PDF", functionName:"generatePdf"}];