Skip to content

Instantly share code, notes, and snippets.

@andycasey
Created June 23, 2025 21:24
Show Gist options
  • Save andycasey/1008a1df3b9fa0cd08b8753f997fcf00 to your computer and use it in GitHub Desktop.
Save andycasey/1008a1df3b9fa0cd08b8753f997fcf00 to your computer and use it in GitHub Desktop.
Google Apps Script for converting all slide decks in a folder to PDF
function convertSlidesInFolderToPdf(fromFolderId, destinationFolderId) {
const folder = DriveApp.getFolderById(fromFolderId);
const destinationFolder = DriveApp.getFolderById(destinationFolderId);
const files = folder.getFilesByType(MimeType.GOOGLE_SLIDES);
while (files.hasNext()) {
const file = files.next();
const deck = DriveApp.getFileById(file.getId());
const pdfBlob = deck.getBlob().setName(file.getName() + ".pdf").getAs('application/pdf');
destinationFolder.createFile(pdfBlob);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment