Is it by anyway possible to convert HTML pages to word with some basic styling like tables , some colored headers, a few images ? I work with python . Are there any good libraries to mimic the representation as closely as possible ?
Asked
Active
Viewed 2,330 times
0
-
did you try win32com from the pywin32 python extensions for windows? – Rudolfwm Aug 13 '14 at 15:24
-
You might look to this question: http://stackoverflow.com/questions/920938/formatted-output-in-openoffice-microsoft-word-with-python – joel goldstick Aug 13 '14 at 15:24
-
or [this link here](http://stackoverflow.com/questions/4226095/python-html-to-doc-converter?rq=1) – Rudolfwm Aug 13 '14 at 15:26
1 Answers
1
You'll need Python for Windows to do it this way, but I'd do it like this. That way you don't even have to convert it yourself.
import win32com.client as win32
ms_word = win32.Dispatch('Word.Application')
ms_doc = ms_word.Documents.Add('your_website.html')
ms_doc.SaveAs('your_word_doc.doc')
ms_doc.Close()
ms_word.Quit()

Charles Clayton
- 17,005
- 11
- 87
- 120
-
-
Yes, I just made that assumption given it was word. What OS are you on? – Charles Clayton Aug 13 '14 at 15:33
-
1On Ubuntu I'd use `AbiWord`. Try `abiword --to=doc filename.odt` – Charles Clayton Aug 13 '14 at 16:36