tags:

views:

278

answers:

3

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.

+1  A: 

This behavior is dictated by the user agent (client), and that is how it should remain. Sorry.

Josh Stodola
Well, any suggested workarounds? I can easily do this if the extension is PDF, but when producing PDF via XDP, that isn't a workaround I can use here.
Dean J
No. Even if it was working as expected in your development environment, you can be assured that there will be plenty of users that have a different experience (because of their different settings). As a general rule of thumb, I don't bother with things like this because it makes sense for the client to be in control this behavior. I wouldn't have it any other way.
Josh Stodola
TBH I really wish people would stop trying to embed PDF in web pages. It's a usability horror and having to have the Reader plugin installed has proved to be a security disaster. Please just give us a link to a PDF file and be done with it.
bobince
For what my client wants, this is absolutely the best approach. Doing pixel-perfect layouts using AJAX is a distant second, because it's much easier (from our experience) to make pixel-perfect PDF.
Dean J
Then you will need to accept the fact that a PDF document is *not* a web page.
Josh Stodola
*I can embed a PDF without a problem.* I can't seem to embed XDP, and am wondering if I'm missing something.
Dean J
A: 

What you are looking for is called Adobe Flashpaper: http://www.adobe.com/products/flashpaper/examples/

Otherwise you cannot dictate how the user will view the PDF.

Jakub
If I put the PDF directly into an iframe, it seems to work just fine on half a dozen different users machines here. If I put XDP/PDF into the iframe or object, no dice.
Dean J
As mentioned above, your milage will vary based on user settings, so you CANNOT dictate how they will display it, thats why Adobe created Flashpaper, so you CAN.
Jakub
Which user settings? If I could turn this off in a browser, that would be enough; I have an unusually high level of user control on this one.
Dean J
A: 

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

Dean J
Dean J