Convert DOC file to DOCX with Java

前端 未结 7 1859
天涯浪人
天涯浪人 2021-02-20 12:43

I need to use DOCX files (actually the XML contained in them) in a Java software I\'m currently developing, but some people in my company still use the DOC format.

Do yo

7条回答
  •  时光取名叫无心
    2021-02-20 13:32

    You may try Aspose.Words for Java. It allows you to load a DOC file and save it as DOCX format. The code is very simple as shown below:

    // Open a document.  
    Document doc = new Document("input.doc"); 
    // Save document. 
    doc.save("output.docx");
    

    Please see if this helps in your scenario.

    Disclosure: I work as developer evangelist at Aspose.

提交回复
热议问题