aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Not showing up pdf
 
Similar Threads
converting byte array to pdf
Open PDF or word doc or text file from byte array data using JSF.
Efficient Streaming Methods
Send PDF file to browser for display
PDF Byte Array to video output stream