在Google Apps脚本对话框中显示PDF查看器 [英] Display PDF viewer inside the Google Apps Script Dialog

查看:55
本文介绍了在Google Apps脚本对话框中显示PDF查看器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Google Spreadsheet附加对话框的对话框中显示PDF.

I want to display a PDF inside a Dialog of a Google Spreadsheet Add-on Dialog.

有关应用程序脚本对话框的更多信息,请参见

more about apps script dialog can be found here

https://developers.google.com/apps-script/guides/html/

<iframe id="iframe" src="https://www.w3docs.com/uploads/media/default/0001/01/540cb75550adf33f281f29132dddd14fded85bfc.pdf"  frameborder="0" height="500px" width="100%"></iframe>

当我检查时,我看到消息资源被解释为文档,但以MIME类型application/pdf传输:"

When I inspect, I see the message Resource interpreted as Document but transferred with MIME type application/pdf: "https://www.w3docs.com/uploads/media/default/0001/01/540cb75550adf33f281f29132dddd14fded85bfc.pdf".

推荐答案

答案:

您可以嵌入Google查看器以使用< iframe> 显示PDF.

Answer:

You can embed the Google viewer to display the PDF using an <iframe>.

<iframe src="https://docs.google.com/viewer?url=https://www.w3docs.com/uploads/media/default/0001/01/540cb75550adf33f281f29132dddd14fded85bfc.pdf&embedded=true" height="1080" width="1920"></iframe>

只需确保更改< iframe> height width 属性.

Just make sure to change the height and width attributes of the <iframe>.

这篇关于在Google Apps脚本对话框中显示PDF查看器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆