File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes converting byte array to pdf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "converting byte array to pdf" Watch "converting byte array to pdf" New topic
Author

converting byte array to pdf

Manish Agarwal
Ranch Hand

Joined: Jun 22, 2004
Posts: 34
Hi,

I have a byte array of a pdf file. I want to show the pdf in web browser using this byte array.Is there any way to do it.

Any suggestions are welcome.


Thanks and Regards,<br />Manish Agarwal<br />SCJP 1.4 (100%)<br />SCWCD 1.4 (98%)<br />SCBCD 1.3 (Preparing)
pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
set the content type ("application/pdf") and content length headers and then just send the bytes.

pascal
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

More of a Servlets question. I'm moving this to that forum.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Note that because a PDF should be considered binary data, you must send the bytes to an output stream from getOutputStream(), not a writer from getWriter().
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: converting byte array to pdf