如何在没有滚动条的情况下一次将 pdf 文件嵌入 html 页面?
我正在尝试使用
<object data="file.pdf#scrollbar=0&;view=Fit"
type="application/pdf"
style="width:100%;height:4000px"></object>
我希望它一次显示一页,适合窗口。但它与垂直滚动条一起连续出现。我该如何修复它?
height:100%
似乎不起作用(扩展足够的高度),我需要在那里放一些大数字。 我检查了滚动条是渲染 pdf 的
我使用 Chrome 浏览器。
I am trying to embed a pdf into html using <object>
.
<object data="file.pdf#scrollbar=0&;view=Fit"
type="application/pdf"
style="width:100%;height:4000px"></object>
I want it to display it a single page at a time, fitting into the window. But it appears continuously with the vertical scrollbar. How can I fix it?
height:100%
does not seem to work (to expand enough height), and I needed to put some large number there.
I checked that the scroll bar is part of the <object>
where pdf is rendered, not any DOM objects surrounding it.
I use Chrome browser.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来你无法控制这一点。顺便说一下,您无法控制 Acrobat(或任何默认的 PDF 查看器)接管 iFrame 的内容。例如,我已将浏览器配置为下载所有 PDF。
(顺便说一句,使用
page=n
链接到某个页面似乎会显示页面从顶部边缘的 1/3 左右开始。)还有其他选择。您可以Google 查找 PDF 到 Flash 转换器/查看器,或者尝试一下pdf.js 用于无插件设置。
It seems you cannot control that. You can't, by the way, control, that Acrobat (or whatever the default PDF viewer is) takes over the content of the iFrame. For example, I've configured my browser to download all PDFs.
(By the way, linking to a certain page with
page=n
seems to display the page start at about 1/3rd of the top edge.)There are alternatives. You can google for PDF to Flash converters/viewers, or you try out pdf.js for a no-plugin setup.