View Full Version : downloading webpage as word document
rizlaa
10-10-2006, 02:29 PM
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.
djr33
10-10-2006, 08:54 PM
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.)
tech_support
10-11-2006, 10:07 AM
hmm... I wonder how Writely can do it.
tech_support
10-11-2006, 10:28 AM
Here, try this:
http://www.phpbuilder.com/columns/yunus20031124.php3
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.