• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Generated PDF download from Tomcat

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,


I convert a html page with PD4ML to PDF.
After that I want to download it via browser. This is used for download:

Open/Save/Cancel dialog appears and SOMETIMES I get exceptions like:
"File does not begin with '%PDF-"
"Corrupted..."
These errors appear very often when opening with Internet Explorer; Especially when i send (almost) simultaneous requests from several browsers. Mozilla works a bit better.
When I redirect Outputstream to file -i ALWAYS get proper PDF document.


How can i always get proper PDF download possibility from Tomcat application?


Regards
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Some browser get unhappy without an accurate content-length header.
2. You are writing to the outputstream as bytes, not characters, right?
3. This is not Tomcat specific but a general servlet problem.

Bill
reply
    Bookmark Topic Watch Topic
  • New Topic