sbraconnier/jodconverter

JODConverter automates document conversions using LibreOffice or Apache OpenOffice.

Java

1,597

1,206 commits

updated Oct 17, 2026

See the code

README

Build Status Coverage Status Codacy Badge OpenSSF Scorecard OpenSSF Best Practices License Maven Central Version Documentation Javadocs Join the chat at https://gitter.im/jodconverter/Lobby Sponsor Donate Buy Me a Coffee

JODConverter

JODConverter, the Java OpenDocument Converter, converts documents between office formats: Word, Excel, PowerPoint, OpenDocument, PDF, HTML, images and many more. It drives a LibreOffice or Apache OpenOffice installation, so it converts whatever that office converts.

It can be used:

  • as a Java library, in your own application;
  • with Spring Boot, through a starter that configures everything;
  • as a command line tool, in your scripts.

📖 Documentation · Release notes · FAQ · Samples

Requirements

JODConverterJavaSpring Boot
5.x17+4.x
4.4.x8+2.x and 3.x

Coming from 4.4? See the migration guide.

Quick start

Add the library, here for LibreOffice (see the modules for the other ones):

<dependency>
    <groupId>org.jodconverter</groupId>
    <artifactId>jodconverter-local-lo</artifactId>
    <version>5.1.1</version>
</dependency>
implementation("org.jodconverter:jodconverter-local-lo:5.1.1")

Then start an office manager once, and convert:

import java.io.File;

import org.jodconverter.core.office.OfficeUtils;
import org.jodconverter.local.JodConverter;
import org.jodconverter.local.office.LocalOfficeManager;

public class Example {

  public static void main(String[] args) throws Exception {
    // Starts an office process, found in its default location, and keeps it for all the conversions.
    LocalOfficeManager officeManager = LocalOfficeManager.install();
    try {
      officeManager.start();

      // The formats are those of the file extensions.
      JodConverter.convert(new File("document.docx")).to(new File("document.pdf")).execute();
    } finally {
      OfficeUtils.stopQuietly(officeManager);
    }
  }
}

An office manager is meant to live as long as the application, and to be shared by all its conversions: starting an office process costs much more than a conversion.

With Spring Boot

Add the starter next to the library:

implementation("org.jodconverter:jodconverter-spring-boot-starter:5.1.1")
implementation("org.jodconverter:jodconverter-local-lo:5.1.1")

enable it:

jodconverter.local.enabled=true

and inject the converter where you need it:

@Service
public class ReportService {

  private final DocumentConverter converter;

  public ReportService(DocumentConverter converter) {
    this.converter = converter;
  }

  public void toPdf(File source, File target) throws OfficeException {
    converter.convert(source).to(target).execute();
  }
}

From the command line

Download jodconverter-cli from the latest release, unpack it, then:

bin/jodconverter-cli document.docx document.pdf

(bin\jodconverter-cli.bat on Windows.)

Going further

Getting help and contributing

License

JODConverter is licensed under the Apache License, Version 2.0.

converter
java
libreoffice
openoffice

sbraconnier/jodconverter

JODConverter automates document conversions using LibreOffice or Apache OpenOffice.

Java

1,597

1,206 commits

updated Oct 17, 2026

See the code

README

Build Status Coverage Status Codacy Badge OpenSSF Scorecard OpenSSF Best Practices License Maven Central Version Documentation Javadocs Join the chat at https://gitter.im/jodconverter/Lobby Sponsor Donate Buy Me a Coffee

JODConverter

JODConverter, the Java OpenDocument Converter, converts documents between office formats: Word, Excel, PowerPoint, OpenDocument, PDF, HTML, images and many more. It drives a LibreOffice or Apache OpenOffice installation, so it converts whatever that office converts.

It can be used:

  • as a Java library, in your own application;
  • with Spring Boot, through a starter that configures everything;
  • as a command line tool, in your scripts.

📖 Documentation · Release notes · FAQ · Samples

Requirements

JODConverterJavaSpring Boot
5.x17+4.x
4.4.x8+2.x and 3.x

Coming from 4.4? See the migration guide.

Quick start

Add the library, here for LibreOffice (see the modules for the other ones):

<dependency>
    <groupId>org.jodconverter</groupId>
    <artifactId>jodconverter-local-lo</artifactId>
    <version>5.1.1</version>
</dependency>
implementation("org.jodconverter:jodconverter-local-lo:5.1.1")

Then start an office manager once, and convert:

import java.io.File;

import org.jodconverter.core.office.OfficeUtils;
import org.jodconverter.local.JodConverter;
import org.jodconverter.local.office.LocalOfficeManager;

public class Example {

  public static void main(String[] args) throws Exception {
    // Starts an office process, found in its default location, and keeps it for all the conversions.
    LocalOfficeManager officeManager = LocalOfficeManager.install();
    try {
      officeManager.start();

      // The formats are those of the file extensions.
      JodConverter.convert(new File("document.docx")).to(new File("document.pdf")).execute();
    } finally {
      OfficeUtils.stopQuietly(officeManager);
    }
  }
}

An office manager is meant to live as long as the application, and to be shared by all its conversions: starting an office process costs much more than a conversion.

With Spring Boot

Add the starter next to the library:

implementation("org.jodconverter:jodconverter-spring-boot-starter:5.1.1")
implementation("org.jodconverter:jodconverter-local-lo:5.1.1")

enable it:

jodconverter.local.enabled=true

and inject the converter where you need it:

@Service
public class ReportService {

  private final DocumentConverter converter;

  public ReportService(DocumentConverter converter) {
    this.converter = converter;
  }

  public void toPdf(File source, File target) throws OfficeException {
    converter.convert(source).to(target).execute();
  }
}

From the command line

Download jodconverter-cli from the latest release, unpack it, then:

bin/jodconverter-cli document.docx document.pdf

(bin\jodconverter-cli.bat on Windows.)

Going further

Getting help and contributing

License

JODConverter is licensed under the Apache License, Version 2.0.

converter
java
libreoffice
openoffice

Project health

Overall

6.6/10

Maintained

10/10

Code review

0/10
OpenSSF Scorecard