Search in sources :

Example 1 with OfficeManager

use of org.artofsolving.jodconverter.office.OfficeManager in project openmeetings by apache.

the class DocumentConverter method createOfficeManager.

public static void createOfficeManager(String officePath, Consumer<OfficeManager> consumer) {
    OfficeManager manager = null;
    try {
        DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
        if (!Strings.isEmpty(officePath)) {
            configuration.setOfficeHome(officePath);
        }
        manager = configuration.buildOfficeManager();
        manager.start();
        if (consumer != null) {
            consumer.accept(manager);
        }
    } finally {
        if (manager != null) {
            manager.stop();
        }
    }
}
Also used : OfficeManager(org.artofsolving.jodconverter.office.OfficeManager) DefaultOfficeManagerConfiguration(org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration)

Aggregations

DefaultOfficeManagerConfiguration (org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration)1 OfficeManager (org.artofsolving.jodconverter.office.OfficeManager)1