OpenOffice.org has a little-known feature that it can run as a service, and this capability has some advantages. For example, you can use OpenOffice. OG becomes a conversion engine. With this conversion engine, you can use network interfaces or command line tools to convert the file format. jodconverter can help you implement the file conversion function of OpenOffice.org.
To use OpenOffice.org as a conversion engine, you must start it as a service so that it listens for connections on a specific port. On the Linux platform, you can use the following command to start OpenOffice.org:
Soffice-Headless-accept = "socket, Port = 8100; URP ;"
On Windows, run the following command:
"C: \ Program Files \ OpenOffice.org 2.2 \ Program \ soffice"-accept = "socket, Port = 8100; URP ;"
Jodconverter is based on Java and you need to install a Java Runtime Environment of version 1.4 or later. Download the latest jodconverter-tomcat-x.x.x.zip file and decompress it to a directory to start jodconverter.
Sh jodconverter-tomcat-2.1.1/bin/startup. Sh
Open http: // localhost: 8080/Converter in the browser and you will see a simple web interface. Select the file to be converted and confirm the format. click the button to convert the file. You can also use the command line to convert the file, for example:
Java-jar jodconverter-2.1.1/lib/jodconverter-2.1.1.jar loremipsum. ODT loremipsum.pdf
Related information:
Build File Format Conversion server: http://blog.csdn.net/oldjavaman/archive/2007/08/14/1742666.aspx
Learn more about OpenOffice.org: http://docs.huihoo.com/openoffice/deepknowlegeofooo-1.html
Http://docs.huihoo.com/openoffice/deepknowlegeofooo-2.html
Http://docs.huihoo.com/openoffice/deepknowlegeofooo-3.html
OpenOffice.org API introduction (3) Translation: OpenOffice.org API introduction (2) Translation: OpenOffice.org API introduction (1)