This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 12761
    
    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
 
Similar Threads
PDF display in JSP
Display PDF in IE from byte array using Servlet
copying file into database
help in converting pdf into byte array
problem reading pdf with iText Library