How to Display a pdf document in a web page(Not seprately,just Inside the webpage) using jsp or servlet?
Asked
Active
Viewed 325 times
0
-
Isn't that normally a thing the browser decide about? – Mikael Östberg Jun 10 '11 at 11:54
2 Answers
0
You need to use the <object>
or <embed>
tag to contain the adobe reader and point to your pdf file.
something like: <embed src="YourFile.pdf" width="500" height="375">
another answer here: EMBED vs. OBJECT

Community
- 1
- 1

Mark Redman
- 24,079
- 20
- 92
- 147
0
You need to set the content type for this on response. call response.setContentType("aplication/pdf"); before writing anything to stream.

sudmong
- 2,036
- 13
- 12
-
See Example [here](http://stackoverflow.com/questions/5968328/question-on-java-servlet-to-open-a-pdf-file-using-itext) or [Here](http://stackoverflow.com/questions/5040776/i-cant-open-a-pdf-in-my-browser-by-java) – sudmong Jun 10 '11 at 12:00