将 .PDF 文件插入 HTML 页面的替代方法

发布于 2024-08-23 17:06:46 字数 217 浏览 17 评论 0原文

目前,我正在使用嵌入标签,其中 src 定向到 .pdf 的位置,但是嵌入标签不允许 z-index 操作或将其他 div 标签放置在其上。在广泛搜索允许嵌入标签 z-index 操作的修复程序后,我发现 adobe 不允许其 pdf 文件发生这种情况。

我需要一种方法将 pdf 文档插入(不使用嵌入或 iframe 标签)到 html 页面中,并允许其他 div 与其重叠。

请帮忙!

Currently I'm using an embed tag with the src directed to the location of the .pdf however the embed tag does not allow for z-index manipulation or other div tags to be placed over it. After extensive searching for a fix to allow for embed tag z-index manipulation I have found that it is adobe that will not allow this to happen with their pdf files.

I need a way to insert (without using embed or iframe tags) a pdf document into an html page and allow other divs to overlap it.

Please Help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青巷忧颜 2024-08-30 17:06:46

<对象>标签,也许?如果这还不行,Adobe 很可能会赢得这场胜利。

The <object> tag, maybe? If that won't do it, Adobe's probably going to win this one.

洒一地阳光 2024-08-30 17:06:46

您可以删除 Acrobat 插件并使用服务器端工具将 PDF 渲染为图像。
在页面上显示该图像并用您喜欢的任何 div 覆盖它。

有许多工具(免费和商业)可以将 PDF 渲染为图像。
我在几个 ASP.NET 项目中使用了 PDFRasterizer.NET 来实现此目的。

像 PDFRasterizer.NET 这样的组件可以让您动态地将 PDF 渲染成图像,并将其直接流回浏览器。在包含文本和一些图像或矢量图形的典型页面上,渲染通常需要(远)不到一秒。您可以将生成的图像保存到磁盘并将其用作缓存以优化性能。
除非您预计会有大量流量,否则实际上没有必要离线处理所有文档。

You could drop the Acrobat plugin and use a server side tool to render the PDF to an image.
Display that image on your page and overlay it with whatever divs you like.

There are many tools available (free and commercial) that can render PDF to an image.
I've used PDFRasterizer.NET for this on a couple of ASP.NET projects.

A component like PDFRasterizer.NET will let you render PDF into images on the fly, streaming it back to the browser directly. On a typical page with text and some images or vector graphics rendering typically takes (much) less than a second. You can save the generated images to disk and use that as a cache to optimize performance.
Unless you expect massive traffic there's no real need to process all documents offline.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文