最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to take screenshot of Google Sheet - Stack Overflow

programmeradmin0浏览0评论

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 0
Add a ment  | 

3 Answers 3

Reset to default 2

You 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:

发布评论

评论列表(0)

  1. 暂无评论