aspose file tools*
The moose likes Java in General and the fly likes convert doc to docx Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "convert doc to docx " Watch "convert doc to docx " New topic
Author

convert doc to docx

lakshman kumaran
Greenhorn

Joined: Aug 16, 2011
Posts: 13
Hi,
Anybody tell me how to convert the doc file to docx file using java.


Thanks,
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42264
    
  64
Use Openoffice in server mode via JODConverter. Or write a lot of code using the Apache POI library.


Ping & DNS - my free Android networking tools app
lakshman kumaran
Greenhorn

Joined: Aug 16, 2011
Posts: 13
Hi,
I am trying to convert doc file to docx file format using JODConverter i got the following exception .

Aug 16, 2011 3:23:31 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection getService
INFO: trying to (re)connect
Exception in thread "main" com.artofsolving.jodconverter.openoffice.connection.OpenOfficeException: could not obtain service: com.sun.star.ucb.FileContentProvider
at com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.getService(AbstractOpenOfficeConnection.java:119)
at com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.getFileContentProvider(AbstractOpenOfficeConnection.java:129)
at com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:116)
at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:104)
at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:74)
at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:70)
at com.wk.doc.DocToPdf.main(DocToPdf.java:53)
Caused by: java.net.ConnectException: connection failed: socket,host=localhost,port=8100,tcpNoDelay=1: java.net.ConnectException: Connection refused: connect
at com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.connect(AbstractOpenOfficeConnection.java:79)
at com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.getService(AbstractOpenOfficeConnection.java:115)
... 6 more


Any idea to resolve this problem

Thanks,
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42264
    
  64
OO runs in server mode on port 8100 on localhost?
lakshman kumaran
Greenhorn

Joined: Aug 16, 2011
Posts: 13
How to run the OO server on port 8100 on localhost?




Thanks,
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42264
    
  64
Have you checked JODConverter's and OpenOffice's documentation?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: convert doc to docx