aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes saving a html file as word document on click of a button 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 » Engineering » HTML, CSS and JavaScript
Bookmark "saving a html file as word document on click of a button" Watch "saving a html file as word document on click of a button" New topic
Author

saving a html file as word document on click of a button

Arvind Kini
Ranch Hand

Joined: Dec 28, 2000
Posts: 31
Hello,
is it possible to save a html file to a word document on the client side on click of a button?
I have a SAVE button on a web page. I need to save its contents into a word document on click of the save.
Help gr8tly appreciated/
Thanks
Arvind
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
It is going to have to be some sort of server side code to the best of my knowledge.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Eric is correct. Your best bet would be to, upon the click of the button, post a request ot a servlet that would output you page with a content type of RTF and marked as an 'attachment'. Search these forums for 'attachment' for the exact sytnax, I don't recall it off the top of my head.
RTF is a text-based markup that Word will understand. It's a lot easier than trying to create the proprietary and ever-changing binary Word format.
There are also 3rd-party libraries that might help you create Word files if RTF is not suitable. But in all cases, this involves server-side processing.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: saving a html file as word document on click of a button