Skip to content

Instantly share code, notes, and snippets.

@trevorfoskett
Last active November 5, 2019 20:48
Show Gist options
  • Save trevorfoskett/360c0ec9504e1813e648a75da70bdde8 to your computer and use it in GitHub Desktop.
Save trevorfoskett/360c0ec9504e1813e648a75da70bdde8 to your computer and use it in GitHub Desktop.
Runs server-side function to return the contents of the document in base64 format.
/*
* Runs server-side function to return the contents
* of the document in base64 format.
*
* @return {string} Base 64'd document content.
*/
function genPDF() {
return new Promise(function(resolve, reject) {
google.script.run
.withSuccessHandler(function(blobB64) {
resolve(blobB64);
})
.createPDF();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment