Last active
November 5, 2019 17:39
-
-
Save trevorfoskett/d4a24e8f65b6b0f5bf34990e9e3f9973 to your computer and use it in GitHub Desktop.
Server-side Google Apps Script code to generate base 64-encoded PDF blob from Google Doc.
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 createPDF() { | |
var docBlob = DocumentApp.getActiveDocument().getBlob(); | |
docBlob.setName(doc.getName() + '.pdf'); | |
var blobB64 = Utilities.base64Encode(docBlob.getBytes()); | |
return blobB64; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment