This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes PDF Streaming on iOS devices Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "PDF Streaming on iOS devices" Watch "PDF Streaming on iOS devices" New topic
Author

PDF Streaming on iOS devices

Dan Lauerman
Greenhorn

Joined: Sep 27, 2011
Posts: 1

I have a JSF page that uses a backing bean to stream a PDF document to the browser. This functionality works great and I haven't had any problems with it until now when testing this functionality on iOS devices.

On Safari on both an iPad and iPod Touch, the PDF stream ends up just being pasted as a non-scrollable layer on the webpage when it gets the response. In the browsers on a desktop, the file prompts to save or open and opens correctly with Adobe Reader. This is an issue because only part of the first page of the PDF shows on the iOS devices and there is no way to view other parts.

I've tested other PDF's on these devices from web and they do not behave the same. Either a PDF application is launched or Safari loads a scrollable preview which are the desired outcomes. Has anyone else had this?

My backing bean writing a buffered input stream of the PDF to an output stream. I have set the following response headers:
response.setContentType ("application/pdf");
response.setContentLength(inputLength);
response.setHeader ("Content-Disposition", "inline;filename=\"" + saveFilename + ".pdf\"");
response.setHeader ("Cache-Control", "must-revalidate, post-check=0, pre-check=0, public");

Please Help! I have attempted to switch content-disposition from inline to attachment, but that did not help.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: PDF Streaming on iOS devices
 
Similar Threads
PDF with jsf
open a pdf inline using MIME in ie7
Making a File load in a Web Sphere application?
pdf downloading problem with IE6
showing pdf in Fire fox giving problem