1

I want to display the PDF version of google sheet. I have tried with

https://docs.google.com/viewer?url=https://docs.google.com/spreadsheets/d/1Yp55fNmcrPQ96eggHpVTEFDCSIUcxEFGnK-TTmv111o/export?format=pdf&embedded=true

The examples here are https://gist.github.com/tzmartin/1cf85dc3d975f94cfddc04bc0dd399be

Code Guy
  • 3,059
  • 2
  • 30
  • 74

2 Answers2

1

You are using the correct syntax to display a public Spreadsheet as a pdf

For my sample sheet as below it works:

https://docs.google.com/viewer?url=https://docs.google.com/spreadsheets/d/1hnx_EWPN3Djs9tOIjfOt0R7XC3bsn66uLdTBxmlQAx8/export?format=pdf&embedded=true

If it is not working for you, either

  • The document is not spreadsheet

  • The id is not correct

  • The sharing permissions are not sufficient - try to set it as Public on the web enter image description here

ziganotschka
  • 25,866
  • 2
  • 16
  • 33
0

You have 3 ways to get PDF of the sheet.

Google apps script getAs('application/pdf') layout wil help.

Then you can open it in iframe.

EDIT: You should publish your spreadsheet before using displaying it.

In your spreadsheet, select Menu > File > Publish To The Web.

You'll see this window. enter image description here

Select desired range to publish and file type.

Then, they provides a link to share/embed etc.

openingnow
  • 134
  • 10