I have a webpage which i wish to allow users to download as a word document (the web page layout/styles are stored in a css file)
is there any quick way of converting the html into a word doc including the css file (ie set the mime type etc???)
I have a webpage which i wish to allow users to download as a word document (the web page layout/styles are stored in a css file)
is there any quick way of converting the html into a word doc including the css file (ie set the mime type etc???)
No. HTML is not a desktop publishing format. There are quite a few differences which just don't work the same way between a browser and a word processor.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Well, yes. There is a way.
It would be, if not more, using PHP to set the right mime type, output as a .doc AFTER converting the formatting. This basically involves writing something just as complex as a browser that will read html and interpret it then replace the formatting with that of word.
So... no, it would be too hard. It's theoretically possible.
Additionally, even if you were to, there are just things that are different about the languages. For a simple example, consider javascript that might crucial to the page. that won't work in word. Other complex formatting things won't either, if they aren't available in both formats. Etc.
Note that you can open a .html format file in word and edit there. I don't recommend this, but if you are trying to import something to word, then that would help. (Outputting from word to html creates incompatible messy code. Bad idea. Don't do that.)
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
hmm... I wonder how Writely can do it.
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
Here, try this:
http://www.phpbuilder.com/columns/yunus20031124.php3
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
Bookmarks