-1

I know it is a repetitive question, but most of the answers are not straightforward for this question. Some say, convert HTML to XHTML and then convert it to Word doc. Some say, right-click on the page and select 'Save as doc'. But my question is, is there any particular API for this, which simply converts the HTML to Doc?

To elaborate, is there any API like iText (which we use for PDF) for Word doc generation?

Thanks.

anotherdave
  • 6,656
  • 4
  • 34
  • 65
OmP
  • 189
  • 1
  • 3
  • 21
  • 1
    possible duplicate of [Writing HTML content into MS WORD using JAVA?](http://stackoverflow.com/questions/19603560/writing-html-content-into-ms-word-using-java), [Convert HTML page into MS word using java](http://stackoverflow.com/questions/9564383/convert-html-page-into-ms-word-using-java), [Convert HTML to DOC with images in Java](http://stackoverflow.com/questions/17151291/convert-html-to-doc-with-images-in-java), and a pile of others. – Michael Petrotta Feb 26 '14 at 04:59
  • check http://stackoverflow.com/a/41937149/1406510 for full code – nanosoft Jan 30 '17 at 13:44

1 Answers1

2

The Apache POI project's goal is to provide a comprehensive Java API for Microsoft Word documents.

However, you should keep in mind that Word formatting is awfully complex and messy. It might be easier to go with a cleaner or more abstracted specification, like PDF.

Best of luck.

yossarian
  • 1,537
  • 14
  • 21