Convert HTML to Word Document

5

Can anyone suggest a way to convert html files to word documents (.doc) in linux, via commandline?

theotherreceive

Posted 2009-08-28T23:12:12.440

Reputation: 798

Answers

2

this quiz has been posted before in the OOo forum:

I need to convert an HTML formatted document to a DOC formatted document. Is this possible via command line?

whether the answers are satisfacory, i wouldn't know.

Molly7244

Posted 2009-08-28T23:12:12.440

Reputation:

3The link is broken – Jared Beach – 2016-04-04T14:15:07.987

2

Thanks, found link to http://www.artofsolving.com/opensource/pyodconverter in there, which does what I want.

– theotherreceive – 2009-08-29T00:33:31.593

you're more than welcome. – None – 2009-08-29T00:42:45.533

1

Libreoffice (and probably OpenOffice) can do this.

libreoffice --headless --convert-to doc FILENAME.html

For more details:

man libreoffice

Jackson

Posted 2009-08-28T23:12:12.440

Reputation: 19

1For me this returns Error: no export filter. Am I missing something obvious? – ohnoplus – 2019-03-27T22:18:13.527

1@ohnoplus I think in newer versions of libreoffice you need to include the more precise filter name, e.g., libreoffice --headless --convert-to "doc:Word 97-2003" filename.html or libreoffice --headless --convert-to "docx:Office Open XML Text" filename.html – frabjous – 2019-08-16T16:27:40.307

2Make that libreoffice --headless --convert-to "doc:MS Word 97" filename.html for the old .doc format. (.docx is what I usually use; and they are horrible at publishing these) – frabjous – 2019-08-16T16:37:48.927