File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not showing up pdf

 
Subha Rangu
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a question in JSP. I am trying to send the byte[] to outputstream and show it on the browser.
Following is my code:
**************************************************************

resp.setContentType("application/pdf");
ServletOutputStream outstream=resp.getOutputStream();
outstream.write(barray);
outstream.flush();
outstream.close();

***************************************************************

I was neither getting an Exception nor displaying the pdf document on the browser. I had printed the size of the byte[] just before giving it to the output stream and it is not null.

Please help me with me..What could be the reason?
Thanks in advance,
Subha
 
John Campbell
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try setting content length also in the response object
 
Subha Rangu
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic