This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* For each placeholder - "{{[placeholder]}}", strip out any HTML and replace | |
* it with the appropriate key value. An example use of this could be using the | |
* HTML from a draft GMail as a template. | |
* | |
* E.g. If the obect were: | |
* | |
* {PlaceHolder1: newValue} | |
* | |
* In the template "{{PlaceHolder1}}" would be replaced with "newValue" even |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Create a PDF by merging values from a Google spreadsheet into a Google Doc | |
// ========================================================================== | |
// | |
// Demo GSheet & script - http://bit.ly/createPDF | |
// Demo GDoc template - 1QnWfeGrZ-86zY_Z7gPwbLoEx-m9YreFb7fc9XPWkwDw | |
// | |
// Config | |
// ====== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dev: andrewroberts.net | |
// Replace this with ID of your template document. | |
var TEMPLATE_ID = '' | |
// var TEMPLATE_ID = '1wtGEp27HNEVwImeh2as7bRNw-tO4HkwPGcAsTrSNTPc' // Demo template | |
// Demo script - http://bit.ly/createPDF | |
// You can specify a name for the new PDF file here, or leave empty to use the | |
// name of the template. Placeholders can also be placed in here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
PDF Create - Email on form submit | |
================================= | |
This script creates a PDF populated with the values submitted in a | |
Google form. | |
The "on form submit" trigger needs to be manually created: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
PDF Creator - Email all responses | |
================================= | |
When you click "Create PDF > Create a PDF for each row" this script | |
constructs a PDF for each row in the attached GSheet. The value in the | |
"File Name" column is used to name the file and - if there is a | |
value - it is emailed to the recipient in the "Email" column. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function exportSpreadsheet() { | |
//All requests must include id in the path and a format parameter | |
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export | |
//FORMATS WITH NO ADDITIONAL OPTIONS | |
//format=xlsx //excel | |
//format=ods //Open Document Spreadsheet | |
//format=zip //html zipped | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 34567890123456789012345678901234567890123456789012345678901234567890123456789 | |
// JSHint - TODO | |
/* jshint asi: true */ | |
(function() {"use strict"})() | |
// API_.gs | |
// ======= | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 34567890123456789012345678901234567890123456789012345678901234567890123456789 | |
// JSHint - TODO | |
/* jshint asi: true */ | |
(function() {"use strict"})() | |
// Properties_.gs | |
// ============== | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Clear all of the config | |
*/ | |
function clearConfig() { | |
Logger.log('Delete Local Script Properties:') | |
if (PropertiesService.getScriptProperties() !== null) { | |
Logger.log(PropertiesService.getScriptProperties().deleteAllProperties()) | |
Logger.log(' Deleted') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Save spreadsheet as a PDF | |
* | |
* Based on Dr.Queso's answer in http://stackoverflow.com/questions/30367547/convert-all-sheets-to-pdf-with-google-apps-script/30492812#30492812 | |
* | |
* @param {String} email Where to send the PDF [OPTIONAL] | |
* @param {String} spreadsheetId Or the active spreadsheet[OPTIONAL] | |
* @param {String} sheetName The tab to output [OPTIONAL] | |
* @param {String} PdfName [OPTIONAL] | |
*/ |
NewerOlder