我想在 Google 电子表格插件对话框的对话框中显示 PDF。
可以在此处找到有关应用程序脚本对话框的更多信息
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>
检查时,我看到消息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 .
代码:
<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>
只需确保更改 height
和 width
<iframe>
的属性.
关于javascript - 在 Google Apps 脚本对话框中显示 PDF 查看器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57203813/