1 Answers

0
votes

Use the export link instead of publishing to the web

Since you want to convert your sheet to a pdf and download it instead of opening it in the browser, you can simply export it.

  • The export URL accepts the portrait=true parameter.
  • The export URL would look as following: https://docs.google.com/spreadsheets/d/FILE_ID/export?exportFormat=pdf&format=pdf&portrait=true
  • Keep in mind that FILE_ID is the file id that you can find in the sheet URL: https://docs.google.com/spreadsheets/d/FILE_ID/edit#gid=0
  • FILE_ID is different than the publishing to the web id (the latter starts with 2PACX-)
  • When exporting the sheet as pdf, portrait=true is actually not necessary, because the sheet will be exported as portrait by default