使PDF保留在嵌入的< object>或< iframe> [英] Getting PDF to stay in an embedded <object> or <iframe>

查看:138
本文介绍了使PDF保留在嵌入的< object>或< iframe>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到PDF将不能在浏览器中完全可控,但这不是我的问题。我的问题是,下面用粗体。

 < div& 
< object
data =$ {pageContext.request.contextPath} /UB04.xml
type =application / vnd.adobe.xdp + xml
width = 415height =500/>
< / div>

XML实际上是一个XDP文件;它提供动态数据和静态PDF的URL,并在Adobe Reader中组合它们。如果是PDF,浏览器会根据需要显示在浏览器中,但是当它作为XDP放置时,它会控制窗口并全屏显示PDF。提供一体式XDP(将PDF嵌入为base64)具有相同的问题。



帮助我使XDP的行为相同作为PDF?



或者,如果我可以使用iText将XDP XML和静态PDF模板粘合在一起, PDF直接,这似乎工作很好。

解决方案

一个可能的解决方案:使用iText加入将数据转换为PDF,完全跳过XDP。


I've edited this quite a bit and bolded my question at this point. I realize that PDF won't be fully controllable in the browser, but that's not my issue here. My problem is, well, below in bold.

<div>
    <object 
        data="${pageContext.request.contextPath}/UB04.xml" 
        type="application/vnd.adobe.xdp+xml" 
        width="415" height="500"/>
</div>

The XML is actually an XDP file; it gives dynamic data and a URL for a static PDF, and combines them in Adobe Reader. This displays in the browser as desired if it's a PDF, but when put in as an XDP, it takes control of the window and opens itself fullscreen to display the PDF. Serving an all-in-one XDP (with the PDF embedded as base64) has the same issue.

Help me make the XDP behave the same as a PDF?

Alternatively, if I can use iText to glue together the XDP XML and the static PDF template, I can serve the PDF directly, which seems to work just fine. Just not sure how to create PDF that route, which is somewhat underwhelmingly documented online.

解决方案

One possible solution: use iText to join the data into the PDF, skipping XDP entirely.

这篇关于使PDF保留在嵌入的&lt; object&gt;或&lt; iframe&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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