OpenOffice 命令行 PDF 创建 [英] OpenOffice command line PDF creation
本文介绍了OpenOffice 命令行 PDF 创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一些用 OpenOffice 编写的文档,我想将其中一些作为 PDF 文件包含在最终构建交付中.我想用自动构建脚本来做到这一点.
I have some documentation written in OpenOffice, and I would like to include some of it as PDF files in the final build deliveries. I would like to do this with the automated build script.
有没有办法使用命令行命令从 OpenOffice 创建 PDF 文件?
Is there a way to create a PDF file from OpenOffice with a command line command?
推荐答案
解决的艺术还有一个非常好的 API 可以在 Java 中执行转换.这有点慢,但它很简单.这就是我使用它的方式:
Art of Solving has also a very good API to perform the conversion in Java. It is a little slow but it is simple enough. This is how I use it:
File inputFile = new File("C:\oreyes\hola.doc");
File outputFile = new File("C:\oreyes\hola.pdf");
OpenOfficeConnection connection = new SocketOpenOfficeConnection(8100);
try {
connection.connect();
} catch(Exception e) {}
DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
converter.convert(inputFile, outputFile);
connection.disconnect();
您可以使用它创建一个 jar 并从命令行处理它.
You can create a jar with that and process it from the command line.
这篇关于OpenOffice 命令行 PDF 创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文