This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Mastering Corda: Blockchain for Java Developers and have Jamiel Sheikh on-line!
See this thread for details.
Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Acrobat Plugin should first open, then I want to stream a PDF

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

when I stream a PDF (which is packaged in a ByteArrayOutputStream) to the Browser, the Acrobat Reader plugin opened not until the whole document
is loaded. Is there a header, or anything else I have to set in my servlet to make sure that first the Acrobat plugin open and then the streaming starts. I need this behaviour, because if my user have a slow internet connection, he should have the chance to see the first page of the document during the rest of the document is still loaded in the backround.

code:

//document = PDF as ByteArrayOutputStream

ServletOutputStream servletOut = response.getOutputStream();

response.setContentType("application/pdf");
response.setContentLength(document.size());

document.writeTo(servletOut);
response.flushBuffer();

servletOut.flush();
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

he should have the chance to see the first page of the document during the rest of the document is still loaded in the backround.



Do a google search on "Linearized PDF" or "Linear PDF".
The PDF itself has to be generated in a particular way to get this behaviour.
 
Chris Jackal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you now i have understood
It's a pity that iText not supported "Linearized PDF's", so I have to look for an alternative possibility to create a linearized PDF.
[ March 18, 2005: Message edited by: Chris Jackal ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic