Save Scheduled PDF Exports to Google Drive
A scheduled conversion is most useful when the output goes straight to an organized Drive folder. This detail covers the Drive-saving logic that makes scheduled exports easy to find and share.
Target folder structure
Decide before writing the script whether PDFs should overwrite a single 'latest' file or accumulate as dated versions. Overwriting is simpler and keeps the folder clean. Dated versions give you a history. Both patterns are easy to implement with DriveApp.
Creating dated subfolders
For dated archives, create a subfolder for each run using the current date: targetFolder.createFolder(Utilities.formatDate(new Date(), tz, 'yyyy-MM-dd')). Save that run's PDFs into the new subfolder. Over time, the parent folder fills up with neatly dated batches.
Sharing the output folder
Share the output Drive folder with the people who need to access the PDFs. Set them as Viewers so they can download files without editing the folder structure. Add the folder URL to the notification email so recipients can navigate directly to the latest batch.
Frequently Asked Questions
How do I prevent the same document from being converted twice?
Track which file IDs have been processed using PropertiesService or a Google Sheet log. Before converting a file, check whether its ID is already in the log. If it is, skip it.
Related article
Use Docs to PDF with Google Drive →Ready to Try It?
Install the free Chrome extension and start converting your Google Docs to PDF in one click.
Install Free Extension