【问题标题】:PDF prevention to download on Google Apps ScriptPDF 防止下载到 Google Apps 脚本
【发布时间】:2013-09-09 00:10:53
【问题描述】:

在 Google 云端硬盘上,用户可以阻止查看者下载 PDF 文件。但我在 Drive API for Google Apps Script(GAS) 上没有找到它。

有什么方法可以使用 GAS 启用它吗?

谢谢。

【问题讨论】:

    标签: pdf google-apps-script google-drive-api


    【解决方案1】:

    如果您启用 Advanced Drive Services,则可以在 Apps 脚本中使用。 然后您可以拨打以下电话:

    Drive.Files.update({'labels': {'restricted': true}}, fileId);
    

    这是针对 update 调用的 Drive API 的文档。

    【讨论】:

      【解决方案2】:

      我过去曾对此进行过调查,但这是不可能的,今天我通过 google 脚本再次查看了 Drive 和 DocList API,但仍然不可能。

      粗略地看一下 DRIVE SDK 也不表明这是可能的。

      您正在寻找什么用例?很多时候,您可以将文档包装在 Google 网站上的 iframe 中以防止下载。

      【讨论】:

      • 感谢您的回复!我需要它,因为我的用户将使用 Drive 来查看生成的 PDF,所以我想阻止下载它们。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-08-29
      • 2021-10-15
      • 2021-12-30
      • 2014-11-26
      • 2015-06-26
      • 1970-01-01
      • 2013-06-26
      相关资源
      最近更新 更多