---
title: 'jodconverter für OpenOffice Dateiformatkonvertierungen'
url: 'https://tutego.de/blog/javainsel/2007/11/jodconverter-fur-openoffice-dateiformatkonvertierungen'
markdown: 'https://tutego.de/blog/javainsel/2007/11/jodconverter-fur-openoffice-dateiformatkonvertierungen.md'
date: '2007-11-23'
description: 'Der zweite Schritt meiner Rechnungserstellung ist die Konvertierung in PDF. Auch dazu gibt es eine prima Bibliothek: . (Einziger Nachteil: viele Jars.) Damit kann man Word, PowerPoint, RTF und alles andere in ein bliebiges Zielformat bringen. private static void ensureStartedOpenOfficeService(){ t…'
taxonomy:
  category:
    - 'Open Source'
---

# jodconverter für OpenOffice Dateiformatkonvertierungen

![Illustration einer tropischen Insel mit Palmen und einem hohen Berg](https://tutego.de/blog/javainsel/user/themes/tutego/images/insel-cover.jpg)# Java Blog für Programmierer

[Java Blog für Programmierer](https://tutego.de/blog/javainsel/)

## jodconverter für OpenOffice Dateiformatkonvertierungen

23.11.2007 · [Christian Ullenboom](https://tutego.de/blog/javainsel/author/admin/)

Der zweite Schritt meiner Rechnungserstellung ist die Konvertierung in PDF. Auch dazu gibt es eine prima Bibliothek: . (Einziger Nachteil: viele Jars.) Damit kann man Word, PowerPoint, RTF und alles andere in ein bliebiges Zielformat bringen.

```java
private static void ensureStartedOpenOfficeService(){  try  {    new Socket( "127.0.0.1", 8100 );  }  catch ( Exception e )  {    String path = "C:/Programme/OpenOffice.org 2.3/program/";    ProcessBuilder processBuilder = new ProcessBuilder( path+"soffice", "-headless", "-accept=\"socket,host=127.0.0.1,port=8100;urp;\"", "-nofirststartwizard" );    try    {      processBuilder.start();    }    catch ( IOException ioe )    {      throw new RuntimeException( ioe );    }  }}public static void convert( String source, String destination ){  ensureStartedOpenOfficeService();    OpenOfficeConnection connection = null;  try  {    connection = new SocketOpenOfficeConnection( 8100 );         connection.connect();    DocumentConverter converter = new OpenOfficeDocumentConverter( connection );    File inputFile = new File( source );    File outputFile = new File( destination );    converter.convert( inputFile, outputFile );  }  catch ( ConnectException e )  {    throw new RuntimeException( e );  }  finally  {    connection.disconnect();  }}
```

Für meine Rechnungen also:

```java
String destination    = "S:/Private/Traida/Bills/bill1";String destinationOds = destination + ".ods";String destinationPdf = destination + ".pdf";convert( destinationOds, destinationPdf );  
```

Kategorien: [Open Source](https://tutego.de/blog/javainsel/category/open-source/)

[← Alle Beiträge](https://tutego.de/blog/javainsel/)

---

## Navigation

- Previous: [OpenOffice als Template-Engine: Dokument einlesen, verändern, schreiben](https://tutego.de/blog/javainsel/2007/11/openoffice-als-template-engine-dokument-einlesen-verandern-schreiben.md)
- Next: [Branching with Eclipse and CVS](https://tutego.de/blog/javainsel/2007/11/branching-with-eclipse-and-cvs.md)
