将Adobe PDF浏览器插件的源设置为字节流?
Adobe 插件的源代码是否可以是 PDF 字节流?
如果是这样,如何在标记中声明它?
编辑1: 好的,让我详细说明一下。我已经构建了一个在 Azure 上运行的网站。该站点的后端是 WCF Web 服务,也在 Azure 上。
该网站的一项特殊功能与报告有关。一旦用户选择了他们想要的报告类型,就会向服务发出请求,并发送回 pdf 文件的字节流作为响应。
现在的问题是用户如何查看该文件?是否可以将 Adobe Acrobat PDF 插件的文档源设置为以下内容:
<OBJECT>
<PARAM src="asdfkjaskflasjdlfkjasd"/> //byte stream
<PARAM mimeType="application/pdf;"/> //stream's mime type
</OBJECT>
编辑 2:
好的,所以没有人愿意尝试这一点。但是,我问的唯一原因是因为完全可以使用以下代码设置图像的源:
<img class="myImage" img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAA"/>
其中 image/png;base64
后面的所有内容都表示编码的图像的字节内容作为 base64 字符串。
那么还有可能吗?
谢谢,
Is it possible to have the source for an Adobe Plugin to be a PDF byte stream?
If so, how would this be declared in markup?
EDIT 1:
OK, so let me elaborate on this. I have built a site that runs on Azure. The site's back-end is a WCF web service, also on Azure.
One particular functionality of the site has to do with reporting. Once the user selects the type of report they want, a request is made to the service and a byte stream of a pdf file is sent back as a response.
Now, the question is how would the user view the file? Is it possible to set the Adobe Acrobat PDF plugin's document source to be something along the lines of:
<OBJECT>
<PARAM src="asdfkjaskflasjdlfkjasd"/> //byte stream
<PARAM mimeType="application/pdf;"/> //stream's mime type
</OBJECT>
EDIT 2:
OK, so no-one wants to take a crack at this. However, the only reason I am asking is because it is entirely possible to set the source of an image with the following code:
<img class="myImage" img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAA"/>
where everything past the image/png;base64
represents the byte content of the image encoded as a base64 string.
So is it still possible?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑 Adobe 插件能否从
data:
URL 获取 PDF 数据。即使在某些浏览器中可行,您也 100% 肯定无法通过这种方式实现跨浏览器解决方案:
data:
URL 在 IE 中不起作用总共 8 个,并且限制为 32 KB”尺码 8 和 9。什么反对简单地在具有 PDF 内容类型的单独资源中提供字节流?
I doubt the Adobe plugin can be made to fetch PDF data from a
data:
URL.And even if it is possible in some browsers, you will with 100% certainty not be able to achieve a cross-browser solution this way:
data:
URLs don't work in IE < 8 at all, and are limited to 32 kilobytes' size 8 and 9.What speaks against simply serving the byte stream in a separate resource with a PDF content-type?