报错内容如下:
[root@localhost win]# java -jar /opt/jodconverter2/lib/jodconverter-cli-2.2.2.jar /tmp/win/3.doc /tmp/win/3.pdf
2013-7-31 17:24:01 com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection connect
信息: connected
2013-7-31 17:24:01 com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection disposing
信息: disconnected
Exception in thread "main" java.lang.IllegalArgumentException: inputFile doesn't exist: /tmp/win/3.doc
at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:90)
at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:74)
at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:70)
at com.artofsolving.jodconverter.cli.ConvertDocument.convertOne(ConvertDocument.java:154)
at com.artofsolving.jodconverter.cli.ConvertDocument.main(ConvertDocument.java:133)
|
问题解决:
此时可能是linux下的jre没有相应的中文字体的问题
复制window字体到jre的字体路径:/usr/java/jdk1.6.0_22/jre/lib/fonts
新建文件夹fallback:
# mkdir fallback
将字体拷贝到/usr/java/jdk1.6.0_22/jre/lib/fonts/fallback目录下
重启openoffice
# ps ax|grep soffice
关闭soffice进程:
# kill 22739
后台启动openoffice:
/opt/openoffice.org3/program/soffice -headless -accept=socket,host=127.0.0.1,port=8100;urp; -nofirststartwizard &