HTML页面中PDF文件的MIME编码 [英] MIME encoding of a PDF file in an HTML page
问题描述
PDF是否可以进行MIME编码并作为HTML页面有效载荷的一部分?
此网站显示您可以在HTML页面中包含MIME编码的图像或CSS:
http://www.greywyvern.com/code/php/binary2base64/
- 但我不知道标记会包含在一个编码的PDF中HTML页面。感谢。
Can a PDF be MIME encoded and included as part of the payload of an HTML page? This site shows that you can include a MIME-encoded image or a CSS in an HTML page: http://www.greywyvern.com/code/php/binary2base64/ -- but I don't know what the markup would be for an encoded PDF included in an HTML page. Thanks.
推荐答案
我用 iframe
和 embed
,在chrome,opera和safari中工作,没有ie或ff
I've tried it with iframe
and embed
, worked in chrome, opera and safari, no ie or ff
<iframe src="data:application/pdf;base64,base64encodedpdf"></iframe>
<embed src="data:application/pdf;base64,base64encodedpdf">
http:// jsfiddle.net/yLx2W/
http://jsfiddle.net/yLx2W/1/
也许经过一些调整,你可以让他们为ff工作,也许ie。
Maybe with some tweaking you can get them to work for ff and maybe ie.
这篇关于HTML页面中PDF文件的MIME编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!