GeeCON Prague 2014*
The moose likes General Computing and the fly likes Dynamically convert Office docs to HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Dynamically convert Office docs to HTML" Watch "Dynamically convert Office docs to HTML" New topic
Author

Dynamically convert Office docs to HTML

Amar Samant
Greenhorn

Joined: Oct 06, 2007
Posts: 7
Hi,
When i upload any office file, pdf document, i want to use the feature "View as HTML" while viewing the uploaded file(similar to the feature in GMAIL when we can view our attachments as HTML ). Can this be done using javascript?.

searching on net i think if the docs are converted to XML then they can be viewed as HTML via XSTL. but i dont know how to do this. Main problem here is i want to achieve the whole thing dynamically.

Waiting for your suggestions and replies. Thanks in advance


SCJP 5.0
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42031
    
  64
That's tricky. One option might be to run OpenOffice in server mode (without a GUI), and have it open the file in question and save it to HTML. Then you display the HTML file in whichever way is convenient. The JODConverter library simplifies this a lot.


Ping & DNS - my free Android networking tools app
Amar Samant
Greenhorn

Joined: Oct 06, 2007
Posts: 7
Thanks for your reply. But i want to achieve this whole thing dynamically on click of the link. If i save the document as an ".mhtm" then i can get the document in web format but not dynamically,here i have to save the document as ".mhtm" using Office. This has to be done manually. Can i get to know how this "Save as .mhtm" works internally (i.e the source code) so that i can try the same code dynamically.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42031
    
  64
I don't know what ".mhtm" is or does, but what I outlined before works programmatically, not manually as you seem to assume. The documentation of the JODCOnverter library talks about it in more detail.
Amar Samant
Greenhorn

Joined: Oct 06, 2007
Posts: 7
Sorry Ulf for getting it wrong.

I have no idea about JODConverter can you please explain in detail.
Thanks for your reply. Please help me out here.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42031
    
  64
Have you read its documentation? If so, what are you wondering about in particular?
 
GeeCON Prague 2014
 
subject: Dynamically convert Office docs to HTML