Generate a PDF (csv/xlsx/ods) download/publish to the web link for new Google Sheets

At ALT we are a Google Apps for Education user and make extensive use of Google Drive for creating and publishing documents. Some of our documents, such as member lists or timetables, get regularly updated and updating links in our websites can be a chore. One of the nice features of documents in Google Drive is you have a couple of ways of publishing documents so anyone can view (no log in required). For Google Sheets the main options are getting a shareable link:

share with others  ... because sharing is good ;)

Or using the ‘publish to the web’ option:

publish to web new school

In the ‘old’ version of Google Sheets the ‘Publish to the web’ option included lots of file types, not just as a web page:

publish-to-web old skool

You can still get new Google Sheets to generate download links for other formats … it’s just a bit complicated. The complicated bit is working out which url tweaks you need. For example, with your magic goggles on you might start spotting a pattern in this url which I’ve line breaked to make easier to see:

https://docs.google.com/spreadsheets/d/1muAOv_chNyCqtx26chZz2RLZlP-wySYsJSFt8UuEO0I/export?
format=pdf&
attachment=FALSE&
size=A4&
fzr=FALSE&
landscape=FALSE&
fitw=TRUE&
gridlines=FALSE&
printtitle=TRUE&
sheetnames=FALSE&
pagenum=FALSE

Remembering all these switches isn’t easy so for our team I’ve shared a simple template with lets us drop in a shared Google Sheet link, choose options for layout and get a url. Here’s a copy in case you find useful:

PDF Link for Google Sheet Template
PDF Link for Google Sheet Template

chevron_left
chevron_right
css.php