1

I need to display several office documents in the browser. but the browser does not recognize them, it downloads them. So the other way is to read the content of the office document and then display it as html. Is it possible using java ? any suggestion ? thx in advance.

iem
  • 93
  • 1
  • 1
  • 11
  • use google doc viewer or convert it into PDF – devpro Dec 15 '15 at 11:25
  • thx for your answer. i use jodconverter but i have to install libreoffice/openoffice in my server. And i don t know if jodconverter can convert many documents in the same time because many users will connect to my application at one time and each one has many documents. secondly if i convert documents to pdf, i will have duplicated documents, (i dont want to delete to original for futur updates). so i will have a stock capacitie problem. so is there a java api to do that without install what ever. thx so much – iem Dec 15 '15 at 13:17

2 Answers2

0

If you are in a Java/JavaEE context, you can use Primefaces/RichFaces...as they present very useful components for this. in the other case I would recommend the use of Apache https://poi.apache.org/

Maouven
  • 330
  • 5
  • 11
  • thx for your answer. yes i am using primefaces. can you give some example. thx in advance – iem Dec 16 '15 at 09:23
-1

It is possible that you can display it through the browser if you specify a proper mime-type.

Maybe this answer will be helpful

What is a correct mime type for docx, pptx etc?

Community
  • 1
  • 1
Jorge_B
  • 9,712
  • 2
  • 17
  • 22
  • thx for answering. i tried a word document (.doc) with type application/msword. but it is not shown in browser. can u give an example thx. – iem Dec 15 '15 at 13:51