Skip to content

Instantly share code, notes, and snippets.

@Wgalter1
Wgalter1 / Create a PDF file from a google sheet using apps script
Created October 7, 2019 18:53
Create a PDF file from a google sheet using apps script
function generatePdf() {
var ss, source, newTab, newSheet;
source = SpreadsheetApp.openById("10wh47mXtvXEdfgdfgdfgdfgdfgdfg").getSheetByName('PrintFATURAFINAL');
ss = SpreadsheetApp.openById("10wh47mXtvXEVUHdfgdfgdfgdfgdfgdfgd");
var pdfName = source.getRange('E10').getDisplayValue();
/*By using the value on a cell as the name for pdf file you be dynamically changed it to be display as a distinct list with no repetition
ei: client A.pdf
client B.pdf
,etc...