在Chromecast中查看.pdf文件 [英] Viewing .pdf files in Chromecast
问题描述
我已经建立了一个类似的.html页面,该页面会将 cast-index.php 加载到Chromecast设备(使用API密钥). cast-index.php 应该以.pdf文件格式显示时间表.到目前为止,我已经尝试了多种方法来完成这项工作,但所有方法都失败了.
I've set up a simle .html page that'll load cast-index.php to the Chromecast device (using the API key). The cast-index.php is supposed to show a schedule in .pdf file format. So far I've tried multiple ways to make this work and all of them have failed.
简单的<嵌入src ="pdf/test.pdf" width ="100%" height ="50%" type ='application/pdf'/>
似乎发挥作用.将 cast-index.php 直接加载到Chrome浏览器中会显示一个完全可读的.pdf文件,但是在Chromecast设备中加载同一页面却不会-只是一个空白框.我已经确认链接没有问题-< img>
标记在使用相同文件夹结构的情况下也可以正常工作.
A simple <embed src="pdf/test.pdf" width="100%" height="50%" type='application/pdf' />
doesn't seem to function at all. Loading the cast-index.php directly into the Chrome browser shows a perfectly readable .pdf file however loading the same page in the Chromecast device does not - nothing but an empty frame.
I have confirmed nothing's wrong with the links - <img>
tags work just fine using the same folder structure.
接下来,我尝试使用Google云端硬盘方法将该.pdf文件的全屏视图作为iframe放置在Google云端硬盘中:
Next I've attempted using the Google Drive method for putting the full screen view of this .pdf file in Google Drive as an iframe:
<iframe src="https://drive.google.com/a/ictmbo.nl/file/d/0B1ogN-bhjfGRZFRTLWhydGJzUlU/preview" width="100%" height="50%"></iframe>
这可以完成工作,但是使我对.pdf文件的查看和缩放几乎没有控制权-特别是考虑到我正在使用< meta http-equiv ="refresh" content ="300">
每隔5分钟刷新一次页面,从而恢复查看该页面的用户进行的任何手动缩放或滚动.
This does its job but leaves me with little control regarding the view and zooming of the .pdf file - especially considering I'm using <meta http-equiv="refresh" content="300">
to refresh the page every 5 minutes, thus restoring any manual zooming or scrolling done by the user viewing this page.
我在这里错过了什么吗?我发现很难相信依靠笨拙的< iframe>
标签是在Chromecast设备上显示.pdf文件的唯一方法.为什么< embed>
不能正常运行(或者< object>
就此而言)?
Am I missing something here? I find it hard to believe relying on clumsy <iframe>
tags is the only way display a .pdf file in on Chromecast devices.
Why does the <embed>
not function properly (or <object>
for that matter)?
推荐答案
Chromecast不支持PDF格式,也没有扩展程序支持在chromecast上运行的chrome上的扩展,因此您必须找到一种方法来将该PDF呈现为html左右;有些人甚至试图从文档页面创建图像并投射图像,但是我不知道它们有多成功.另一种选择是使用远程显示API.
PDF is not a supported format for chromecast and there are no extensions to support that on the chrome running on the chromecast either, so you have to find a way to render that PDF as an html or so; some have even tried to create images from pages of the doc and cast images but I don't know how successful they have been. Another option is to use the remote display apis.
这篇关于在Chromecast中查看.pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!