如何获取Google Sheet的屏幕截图

问题描述 投票:0回答:2

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

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

javascript google-apps-script google-sheets google-apps google-spreadsheet-api
2个回答
2
投票

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

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

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


0
投票

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

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

screenshot

© www.soinside.com 2019 - 2024. All rights reserved.