my dog learned polymorphism*
The moose likes Other Open Source Projects and the fly likes Display pdf in browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Display pdf in browser" Watch "Display pdf in browser" New topic
Author

Display pdf in browser

amarshi mohanty
Ranch Hand

Joined: Jul 01, 2008
Posts: 110
Hi ,
Anyone has sample code to display a pdf text file on browser.I am able to display pdf having an image in browser.


Amarshi


SCJP (97%), SCWCD (95%))
Shobhit Khandelwal
Greenhorn

Joined: Feb 19, 2009
Posts: 24
iText library(api for pdf generation) may be useful for your problem.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42280
    
  64
A PDF is a PDF, no matter whether it contains text of images. Why do you think that makes a difference?


Ping & DNS - my free Android networking tools app
Kuldip Shetty
Ranch Hand

Joined: Jan 07, 2010
Posts: 42

To display the PDF contents on the browser you can set the HttpServletResponse ContentType as "application/pdf" and then put the file contents in the OutputStream otptStream = response.getOutputStream();

Kuldip
Marco Bartolini
Greenhorn

Joined: Dec 14, 2009
Posts: 9



System.out.print("Hello World! SCJP 5 79% - SCWCD 5 86%");
 
wood burning stoves
 
subject: Display pdf in browser