I would like to know is there any way, screenshot could be taken in Google Sheets using Google Apps Script. I browsed I couldn't see this question or answer anywhere.
Or can it be done in any other way if not using Google Apps Script.
I would like to know is there any way, screenshot could be taken in Google Sheets using Google Apps Script. I browsed I couldn't see this question or answer anywhere.
Or can it be done in any other way if not using Google Apps Script.
Share Improve this question edited Mar 3, 2016 at 14:56 Mogsdad 45.8k21 gold badges162 silver badges285 bronze badges asked Mar 3, 2016 at 9:30 Gopinath ShivaGopinath Shiva 3,8925 gold badges28 silver badges50 bronze badges 03 Answers
Reset to default 2You will not be able to take a screenshot with apps script. It's not possible to use the HTML features others mention because of security restrictions, either your script interface runs with iframe mode, or using caja, either way you can't access the parent window and caja will block those html5 methods.
Your best option is to use Google Apps Script to convert the sheet into PDF.
If you have trouble converting to PDF, see this other answer: Google Apps Script - Create PDf from Spreadsheet produces pdf of Google sign in page.
Use a javascript library such as this: http://www.jquerybyexample/2013/08/take-webpage-screenshot-html5-jquery-javascript.html
It may be in violation of Google policies though, as it is blocked by them:
Here is a tutorial that explains how can you achieve this: https://blog.rasterwise./how-to-take-a-screenshot-on-google-sheets/
Essentially you can use a cloud screenshot API and instrument Google App Script to invoke the API as a function in Google Sheets.
This basically allows you to have a list of URLs that you can pass as parameters of the custom function as shown in the screenshot below: