// Sheets · Gmail · Drive

Export a Google Sheet to PDF and email it on a schedule.

Render the active spreadsheet as a PDF, attach it to a Gmail message, send it to a recipient list — all in one Apps Script function. Schedule it Friday afternoon for the weekly report.

I want my Friday report mailed out without me opening a sheet. PDF attachment, three recipients, done.

The script

copy · paste · trigger
exportSheetAsPdf.gs
Apps Script
// Render the active spreadsheet to PDF and email to a list.
// Schedule on a weekly trigger for an automated Friday digest.
const RECIPIENTS = ['team@example.com', 'manager@example.com'];

function exportSheetAsPdfAndEmail() {
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const blob = ss.getAs('application/pdf').setName(ss.getName() + '.pdf');

  const subject = 'Weekly report — ' + ss.getName();
  const body = 'Latest snapshot attached. Open the live sheet: ' + ss.getUrl();

  RECIPIENTS.forEach(to => {
    GmailApp.sendEmail(to, subject, body, {
      attachments: [blob],
      name: 'bulldo.gs',
    });
  });
}

Need a variant? Gnaw writes a custom version from one sentence — fields, triggers, edge cases handled.

Walkthrough

How it works

SpreadsheetApp.getActiveSpreadsheet().getAs("application/pdf") tells Google to render the entire workbook to PDF using its built-in export engine. The result is a Blob — the same shape Drive and Gmail expect for binary attachments.

GmailApp.sendEmail's options object accepts `attachments` as an array of Blobs. The PDF rides along with the email; the recipient gets a normal Gmail attachment.

The script loops over RECIPIENTS one at a time so each gets the message in a separate thread. Use BCC instead if you want a single thread (set options.bcc and only send once).

How to schedule it

Open Triggers in the Apps Script editor and add a weekly time-based trigger that fires exportSheetAsPdfAndEmail() at your chosen slot (Friday 4pm is the classic).

If you want different ranges per recipient (e.g. each manager sees only their team's tab), switch from getActiveSpreadsheet() to URL-based PDF export with `gid` and `range` query params — the bulldo.gs generator can rewrite the function shape for you.

Customising the PDF output

Apps Script's getAs() uses default export settings (portrait, fit-to-width, all sheets). For more control — landscape, single sheet, no gridlines — use UrlFetchApp.fetch against the export URL: `https://docs.google.com/spreadsheets/d/<id>/export?format=pdf&portrait=false&gridlines=false`.

That path needs an OAuth token, which Apps Script provides via ScriptApp.getOAuthToken(). The pattern is well-documented; the bulldo.gs Pro tier ships a tested wrapper.

Want a custom version?

Describe your sheet and the rule you want. Gnaw writes the Apps Script — fields, triggers, edge cases — in one shot.

FAQ

4 questions
How big can the PDF be?
Gmail attachments cap at 25MB. A typical multi-tab Sheet renders to 50KB-2MB. If you exceed the cap, switch to writing the PDF to Drive and sharing a link instead.
Can I send to dynamic recipients pulled from a sheet?
Yes. Replace the RECIPIENTS constant with `sheet.getRange("A2:A").getValues().flat().filter(Boolean)` to pull from column A.
Will the PDF include hidden tabs?
By default yes — the entire workbook renders. Hide tabs at the Sheet level (right-click → Hide sheet) or use the URL-based export with a specific `gid`.
How do I schedule a different cadence per recipient?
Make a separate function per cadence (sendDailyDigest, sendWeeklyDigest), each with its own RECIPIENTS list, and add separate triggers. Apps Script supports up to 20 triggers per script.