I am trying to create a .docx file using java but for some reason I can't open the file. The error comes "Problem with the content of file". Does anyone knows how to fix this problem?
Select the folder where you want to save your document. The dialog box will open > Select "Save as" > In the "Save as type" menu > Select the option "Word document (. docx)" > Click on the "Save as" button and a copy of your file will be saved in Docx format. I hope the information is useful.
Docx4j is a Java library used for creating and manipulating Office OpenXML files – which means it can only work with the . docx file type, while older versions of Microsoft Word use a . doc extension (binary files). Note that the OpenXML format is supported by Microsoft Office starting with the 2007 version.
Tried multiple libraries
This one is free. http://www.docx4java.org/trac/docx4j
Also check aspose (is not free) http://www.aspose.com/categories/java-components/aspose.total-for-java/default.aspx
you may use http://poi.apache.org/ to create such files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With