Build a Slide-to-PDF handout generator
Export a clean, notes-included PDF of a Northwind deck for handouts.
Published Oct 19, 2025
Northwind runs client workshops, and every workshop ends with the same small chore — turning the slide deck into a PDF handout and dropping it in the shared folder. File → Download → PDF does the job, but it lands the file in Downloads, where it has to be renamed and moved by hand. Done a dozen times a month, that adds up.
This script removes the manual steps. Given a deck and a destination folder, it exports the deck as a PDF, names it after the deck, and saves it straight into the folder. It is the simplest automation in the Slides set, and a good building block for any “make a PDF and file it” workflow.
What you’ll need
- The file ID of the Google Slides deck to export — the long string in the deck’s URL.
- The folder ID of the Drive folder where the handout should be saved.
- Edit access to that folder, so the script can create files in it.
The script
// The deck to export and the folder the PDF should land in.
const DECK_ID = '1abcDeckId';
const OUTPUT_FOLDER_ID = '1abcFolderId';
/**
* Exports a Slides deck as a PDF and saves it into a Drive folder,
* named after the deck itself.
*/
function deckToPdf(deckId, outputFolderId) {
// Fall back to the configured IDs when called with no arguments.
deckId = deckId || DECK_ID;
outputFolderId = outputFolderId || OUTPUT_FOLDER_ID;
// Get the deck as a Drive file and render it to a PDF blob.
const file = DriveApp.getFileById(deckId);
const pdf = file.getAs('application/pdf')
.setName(`${file.getName()}.pdf`);
// Create the PDF in the target folder and log where it landed.
const saved = DriveApp.getFolderById(outputFolderId).createFile(pdf);
Logger.log('Saved handout: ' + saved.getUrl());
}
How it works
deckToPdfaccepts a deck ID and a folder ID, but falls back to theDECK_IDandOUTPUT_FOLDER_IDconstants when run with no arguments — so it works both from the editor and as a reusable helper.- It fetches the deck as a Drive file with
getFileById. A Slides deck is a Drive file, soDriveAppcan read it directly. getAs('application/pdf')asks Drive to render the deck into a PDF blob — this is the same export Drive performs when you download a deck as a PDF.setNamenames the blob after the deck, with a.pdfextension, so the handout is easy to recognise.createFilewrites the blob into the destination folder, and the script logs the new file’s URL so you can click straight through to it.
Example run
With a deck called “Q2 Client Workshop” and a “Handouts” folder, running
deckToPdf produces:
| Before | After |
|---|---|
| Deck “Q2 Client Workshop” in Slides | Same deck, untouched |
| ”Handouts” folder empty | ”Handouts” folder contains “Q2 Client Workshop.pdf” |
The log shows a line like Saved handout: https://drive.google.com/file/d/.../view,
a direct link to the new PDF.
Run it
This is an on-demand job — run it whenever a handout is needed:
- In the Apps Script editor, set
DECK_IDandOUTPUT_FOLDER_IDto your deck and folder. - Select
deckToPdfand click Run. - Approve the authorisation prompt the first time.
- Open the destination folder, or click the logged link, to find the PDF.
Watch out for
- The PDF export does not include speaker notes.
getAs('application/pdf')renders the slides only. For a notes-included handout, fetch the Slides export URL withformat=pdfper slide and assemble the pages, or copy the deck into a Doc layout first. - Running the script twice creates a second file with the same name — Drive allows duplicate names. Delete or overwrite the old PDF if you need just one.
getAsrenders the deck at its current state. Make sure every placeholder is filled before exporting, or the handout will show raw{{tokens}}.- Very large decks can take a while to render and may approach the script execution time limit. For long decks, run the export on its own rather than inside a bigger batch job.
- The script needs edit access to the destination folder. A view-only folder
will throw a permissions error on
createFile.
Related
Auto-publish a deck as an embeddable web page
Push a Northwind deck live after approval — set it to publish-to-web automatically.
Updated Jan 11, 2026
Build a Slides-to-images exporter
Convert each slide to a PNG for the web — for Northwind's social posts and blog embeds.
Updated Jul 20, 2025
Generate sales-enablement decks per segment
Tailor Northwind's messaging slides by audience segment — fintech, healthcare, retail.
Updated Dec 28, 2025
Extract all deck text into a sheet
Pull text out of every slide for review, translation, or copy-editing.
Updated Jan 4, 2026
Insert chapter divider slides from an outline
Add section-break slides between chapters in a Northwind deck.
Updated Dec 21, 2025