我怎样才能让两个不同的PDF文件出现在同一个iframe中? [英] How can I make two different PDF files appear in the same iframe?

查看:109
本文介绍了我怎样才能让两个不同的PDF文件出现在同一个iframe中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用FPDF类创建了一个多页PDF文档,然后我使用了一个iframe来显示多页文档。



这里是结果示例: p>

我想在另一页上做同样的事情,除了有点不同。我想让用户上传两个单独的PDF,然后在相同的iframe中显示这两个PDF,而不是显示一个多页PDF文档。



如何让两个不同的PDF文件出现在相同的iframe中

解决方案

PDF插件将完全控制iframe,并且无法处理多个文件。



您可以如何解决这个问题:



两个IFRAME



想到一个简单的解决方案就是在iframe中有一个HTML页面,它又包含两个 iframe s甚至包含 frame s。



你必须知道这是否适合你 - 魔鬼将会在这里详细说明,例如,不可能同步滚动位置或缩放级别,这可能是您想要的。



合并PDF



我唯一能想到的唯一实现这种方法的方法是生成一个PDF,将两个PDF相邻合并。这不是微不足道的。查看以下问题,例如:


  • PHP - 如何合并/合并多个pdf

  • https://stackoverflow.com/questions/2418871/need-to-merge-multiple-pdfs-into-a-single-pdf-with-table-of-contents-sections\">需要将多个PDF合并为一个PDF与目录部分




搜索PHP PDF合并 。


I used the FPDF class to create a multi-page PDF document and then I used an iframe to display the multi-page document.

Here is an example of the result:

I want to do the same thing on another page, except a bit different. Instead of displaying one multi-page PDF document, I would like to let the user upload two separate PDF's and then I display the two PDF's within the same iframe.

How can I make two different PDF files appear in the same iframe

解决方案

The PDF plugin will take full control over the iframe, and can not deal with multiple files.

What you could do to work around it:

Two IFRAMEs

One easy solution that comes to mind is having a HTML page in the iframe, that in turn contains two iframes or even frames.

You'd have to find out whether this works for you - the devil will be in the detail here, for example, it will not be possible to synchronize the scroll positions or zoom levels, which is probably what you want.

Merge PDFs

The only real way to do this that I can think of is to generate a PDF that merges the two PDFs next to each other. This is not entirely trivial. Check out the following questions for example:

there are more on SO when searching for "PHP PDF merge".

这篇关于我怎样才能让两个不同的PDF文件出现在同一个iframe中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆