• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display pdf in browser

 
amarshi mohanty
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Shobhit Khandelwal
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
iText library(api for pdf generation) may be useful for your problem.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A PDF is a PDF, no matter whether it contains text of images. Why do you think that makes a difference?
 
Kuldip Shetty
Ranch Hand
Posts: 43
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic