-2

I am working on a Google sheets project where I want to create pdfs by using data from google sheets. I can easily Interact with google sheets to get the data that I need. I have an html page as Template. I want to somehow put values from my Google appscript into this html page and later think of how to convert it into pdf. But on Google appscript, the document keyword doesn't work meaning I can't use innerHTML or getElementById. What other ways can I achieve this? Any ideas?

sakib11
  • 496
  • 1
  • 5
  • 20

1 Answers1

2

I cannot give the entire process, but could guide you through the idea. In case you have errors, you should be able to find help in SO

Please refer to the Sheets API documentation by google.

Basically, from your html template, you will have to request for the data from google sheets using the API. Once you get the data, you can use it to update the DOM in HTML and create the required page.

Then you could use jspdf refer this SO answer to convert it into a pdf.

Dhananjai Pai
  • 5,914
  • 1
  • 10
  • 25
  • I did have a look at Google sheets Api earlier. I was looking to see if there were other ways to do this. But the Jspdf will be a perfect fit for me. Thank you so much. – sakib11 Oct 08 '19 at 06:48