Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Not showing up pdf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Not showing up pdf" Watch "Not showing up pdf" New topic
Author

Not showing up pdf

Subha Rangu
Greenhorn

Joined: Jul 23, 2004
Posts: 29
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

Joined: Aug 12, 2004
Posts: 4
Try setting content length also in the response object
Subha Rangu
Greenhorn

Joined: Jul 23, 2004
Posts: 29
Thanks for the reply...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not showing up pdf
 
Similar Threads
Send PDF file to browser for display
Open PDF or word doc or text file from byte array data using JSF.
converting byte array to pdf
PDF Byte Array to video output stream
Efficient Streaming Methods