如何获取Google Sheet的屏幕截图

时间:2016-03-03 09:30:50

标签: javascript google-apps-script google-sheets google-apps google-spreadsheet-api

我想知道有没有办法,可以使用Google Apps脚本在Google表格中截取屏幕截图。我浏览过,我无法在任何地方看到这个问题或答案。

如果不使用Google Apps脚本,也可以以其他任何方式完成。

2 个答案:

答案 0 :(得分:2)

您将无法使用应用脚本截取屏幕截图。由于安全限制,无法使用其他人提及的HTML功能,无论是使用iframe模式运行脚本界面,还是使用caja,无论是哪种方式都无法访问父窗口,caja都会阻止这些html5方法。

您最好的选择是使用Google Apps脚本将表格转换为PDF格式。

如果您无法转换为PDF,请参阅另一个答案:Google Apps Script - Create PDf from Spreadsheet produces pdf of Google sign in page

答案 1 :(得分:0)

使用如下的javascript库: http://www.jquerybyexample.net/2013/08/take-webpage-screenshot-html5-jquery-javascript.html

它可能违反了Google政策,因为它被它们阻止了:

screenshot