Set Up a Daily Bulk PDF Export from Google Drive
Daily PDF exports are useful for workflows where documents change frequently and stakeholders need a fresh PDF every morning. A Google Apps Script with a daily time trigger handles this automatically. Write the function once, set the trigger, and it runs at the same time every day without any manual steps.
Writing the daily export function
In Apps Script, write a function that opens a specific Drive folder using DriveApp.getFolderById(), iterates over the files, exports each Google Doc, Sheet, or Slides file as a PDF using the MIME type 'application/pdf', and saves the output to a destination folder. Name the destination folder with the current date for easy identification.
Setting the daily trigger
In the Apps Script editor, click 'Triggers' in the left menu. Add a trigger for your function, select 'Time-driven', then 'Day timer', and choose the time of day. Google runs the trigger within an hour of the time you choose.
Managing accumulating files
Daily exports create a new set of PDFs every day. If the destination folder is not organized by date, it fills up quickly. Create a new dated subfolder in the script each day using Utilities.formatDate() to generate a date string for the folder name.
Frequently Asked Questions
Can I run a daily export on files that only changed since the last export?
Yes. Use the file's last modified date in the script to filter only files updated since the previous run. DriveApp file objects have a getLastUpdated() method for this.
What if the source folder is empty on some days?
The script runs and finds no files to convert. It completes without errors. Add a check in the script to skip sending a notification if no files were found.
Ready to Try It?
Install the free Chrome extension and start converting your Google Docs to PDF in one click.
Install Free Extension