• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

convert doc to docx

 
lakshman kumaran
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Anybody tell me how to convert the doc file to docx file using java.


Thanks,
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Openoffice in server mode via JODConverter. Or write a lot of code using the Apache POI library.
 
lakshman kumaran
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OO runs in server mode on port 8100 on localhost?
 
lakshman kumaran
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to run the OO server on port 8100 on localhost?




Thanks,
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked JODConverter's and OpenOffice's documentation?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic