Export PDF from a Google Sheet (WITH OPTIONS!)

Export PDF from a Google Sheet (WITH OPTIONS!)

Let's export a PDF from a Google Sheet


At the end of a Google Sheet url you'll add /export and then a question mark:


While your original URL will have "/edit#gid="_____ some GID, you should


A pdf export URL  will look like this:


More PDF Options

There are more options you can add to a PDF export URL. To add these options just add an ampersand between the options.

The end of a url might look like this


and you can keep adding options of your choice.



Select a number between 1 and 10

size=             paper size. 0=letter, 1=tabloid, 2=Legal, 3=statement, 4=executive, 5=folio, 6=A3, 7=A4, 8=A5, 9=B4, 10=B5

Repeat Row Headers


Choose either true or false

Portrait or Landscape


choose either true or false

When you select false that is  landscape

fit window or actual size


choose either true or false

true is Fit window, false is Actula size  

Show Gridlines or Hide Gridlines


choose either true or false

True shows gridlines, while false hides gridlines.

Show Title in PDF


choose either true or false

Show Page Numbers or Not


Choose eitehr Center or Undefined.

CENTER = show page numbers

UNDEFINED = do not show page numbers

Attach to an Email

attachment = true/false      

Leave this as true, but this type of selection can be used in Apps Script to send a pdf as an attachment in an email.

Sheet Id if you want a specific sheet


Add a SheetId for the sheet you want to create a pdf of.

The first sheet will be 0. others will have a unique ID.

Leave this completely off the url, for all sheets.

Export a Range from a google Sheet as a PDF

You will need all the below selections to export a range.

SheetID (as gid), Start Row, Start Column, End Row, and End Column.

Sheet ID


gid must be included. The first sheet will be 0. others will have a unique ID you can see in the url of your browser.


This selection seems to be always false. As per tests.


same as ir, always false.

Start Row


this must be the start Row number minus 1. Therefore row 1 would be 0 , row 15 would be 14, and you can do the math on the rest of them.

Start Column


This must be the start column number minus  1 . Therefore column 1 would be 0, column 2 would be 1, and so on and so on. You can do the math yourself.

End Row


This is the End Row number

End Column


This is the end column number