有没有办法将PDF文档嵌入网页并同时禁用下载?如果可能的话,我希望使用html5 / css3解决方案。如果没有其他办法,我会再做其他事情。
是的。就在这里:
<div id="pdf">
<object width="100%" height="650" type="application/pdf" data="[ImageURLHere]#zoom=85&scrollbar=0&toolbar=0&navpanes=0" id="pdf_content" style="pointer-events: none;">
<p>Insert your error message here, if the PDF cannot be displayed.</p>
</object>
</div>
Run Code Online (Sandbox Code Playgroud)
该pointer-events: none
造型也将阻止用户右键点击PDF和下载。
小智 6
实际上,实际上,您可以在Google云端硬盘中调整“阻止查看者下载”,然后将PDF文件设置为公开,这样每个人都可以在Viewer中查看PDF,但是没有人可以下载。我希望这会对某些人有所帮助。
小智 -1
2017 注意:自最初回答以来,此功能已移动位置并且实现也已更改。
Google Viewer 提供了一个解决方案。
使用它为您生成的 iframe。