0
我想用JODConveter将office文件转换为pdf。我已遵循[此链接]中的所有步骤http://www.artofsolving.com/node/14.html通过使用JODConveter上传DOC文件显示错误
但它显示错误。 enter image description here
我想用JODConveter将office文件转换为pdf。我已遵循[此链接]中的所有步骤http://www.artofsolving.com/node/14.html通过使用JODConveter上传DOC文件显示错误
但它显示错误。 enter image description here
1日需要设置开放式办公的路径变量,然后打开CMD用开放式办公室安装位置,然后运行命令
soffice -headless -accept="socket,host=localhost,port=8100;urp;" -nofirststartwizard
使用此代码Java项目:
OpenOfficeConnection connection = new SocketOpenOfficeConnection("localhost",8100);
try {
connection.connect();
long t1 = System.currentTimeMillis();
DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
converter.convert(inputFile, outputFileLoacation);
long t2 = System.currentTimeMillis();
System.out.println(input + " = " + (t2 - t1) + " ms");
} catch (ConnectException e) {
e.printStackTrace();
} finally {
if (connection.isConnected()) {
connection.disconnect();
}