Page 1 of 1

Convert doc to docx using docx4j .

PostPosted: Thu Jan 22, 2015 6:48 pm
by aguna
When i Convert doc file to docx file using docx4j

The alignment is missing,some extra special characters are coming,table is not present.

Have used the following code

Code: Select all
String localPath = "DocFile.doc";

                  WordprocessingMLPackage mlPackage = Doc.convert(iStream);

                     String outputfilepath = "DocxFile.docx";
                   
                     out.save(new File(outputfilepath));

Re: Convert doc to docx using docx4j .

PostPosted: Thu Jan 29, 2015 11:13 am
by jason
That's proof of concept level code only. Contributions/improvements welcome.

If you are working on it, the first thing I'd suggest is that you update the poi dependency to the current poi release.

(Maybe poi these days has code in it to convert from HWPF to XWPF? See further http://poi.apache.org/document/ )

An alternative approach would be to use LibreOffice via JODConverter