• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

PDF Streaming on iOS devices

Posts: 1
IBM DB2 Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.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.
    Bookmark Topic Watch Topic
  • New Topic