Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Convert Doc to PDF
- function example61() {
- //Make copy of Doc
- const masterDoc = DriveApp.getFileById('ADD FILE ID HERE');
- const newDoc = masterDoc.makeCopy("EXAMPLE 61 - Company document");
- const newDocId = newDoc.getId();
- //create a PDF file from this Doc
- const pdf = DriveApp.getFileById(newDocId).getAs('application/pdf');
- pdf.setName(newDoc.getName() + ".pdf");
- const docPdf = DriveApp.createFile(pdf);
- //Add a copy of pdf in doc folder, delete original pdf, & delete orig Doc
- const folder = DriveApp.getFolderById('ADD FOLDER ID HERE');
- folder.addFile(docPdf);
- DriveApp.removeFile(docPdf);
- DriveApp.getFileById(newDocId).setTrashed(true);
- }
- //Create image of a map
- function example62() {
- const map = Maps.newStaticMap().setCenter('Chepstow castle, Chepstow, UK');
- DriveApp.createFile(map);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement