Google Script Google sheets Our products

How to Convert Google Spreadsheet to PDF and Send as Email Attachment

Now a days Google Drive has gain a vast popularity. We have seen  people   gradually migrating from desktop based office  software  to browser based Google Sheet and Docs. Sometimes we need Google Sheet data to be emailed to somebody as PDF as email attachment and at times we also want this to happen recurrently. Keeping these in mind we have come up with an interesting solution.

Spreadsheet Mailer – Google Spreadsheet Add-on

This spreadsheet add-on can help you to easily convert an active spreadsheet to PDF and email as an attachment. 

Features

  1. Convert spreadsheet to PDF – just you need to install the add-on
  2. Select which sheets to export
  3. If exporting as PDF, provide other configuration parameters such as title, grid, layout etc.
  4. Schedule recurring emails with specific time interval such as hourly, daily, weekly etc.
  5. View all scheduled emails and cancel them anytime.

How it works ?

To convert Google Spreadsheet to PDF or any other file we can append specific query parameters to its URL. Here is an example URL which shows all params to get the output in different format.

https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=SPREADSHEET_ID&exportFormat=pdf&gid=SHEET_ID&gridlines=true&portrait=false&fzr=true&sheetnames=false&fitw=true
Parameter Meaning
exportFormat It can be pdf, xlsx or csv. It downloads the spreadsheet in specific file format.
gid Download a specific sheet instead of the entire spreadsheet. Get the gid from the spreadsheet URL.
gridlines Show or hide gridlines.
portrait Set the layout. Portrait or landscape.
fzr Freeze the first row in each page.
sheetnames Show or hide sheetnames in page header.
fitw Display all columns in a single page, font-size may become smaller.

Bonus tips

  • Just append your spreadsheet ID, grid ID in above URL and hit in browser to check how it works.
  • To export all sheets just ignore the gid parameter.
  • When exportFormat is other than pdf, other params such as gridlines, fzr etc. will be ignored. 
  • Hidden sheets are not exported with above URL and this is expected.
  • CSV format only contains data but no cell and font formatting while the other formats does.

2 thoughts on “How to Convert Google Spreadsheet to PDF and Send as Email Attachment”

    1. This add-on offers many more functionalities such as various timer options (hourly, daily, weekly), type of the attachment (pdf, xlsx). It has also some advanced options like paper size, grid lines, frozen rows, orientation etc.

Leave a Reply

Your email address will not be published. Required fields are marked *