February 2014
Beginner to intermediate
178 pages
4h 2m
English
As of this writing (December 2013), Google Apps Script has no possible way to print a document. Printing all or part of a spreadsheet is a common activity, one that we might want to automate using a script. Unfortunately, security considerations limit Google Apps Script access to local resources such as printers.
As a workaround for this limitation, our script can export spreadsheets to PDF and send them by e-mail or store them in Google Drive.
A quick example that won't need too much explanation is as follows:
function sendThisSsAsPdf(){ var ss = SpreadsheetApp.getActiveSpreadsheet(); var ssID = ss.getId();// get the file unique id to use with driveApp var pdf = DriveApp.getFileById(ssID).getAs('application/pdf');//get ...Read now
Unlock full access