Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save groupdocs-com-kb/309a9649cef6c898bbe1d9195d310d1c to your computer and use it in GitHub Desktop.
Save groupdocs-com-kb/309a9649cef6c898bbe1d9195d310d1c to your computer and use it in GitHub Desktop.
How to Convert ODT to JPG using Java. For more information, please follow link: https://kb.groupdocs.com/conversion/java/how-to-convert-odt-to-jpg-using-java/
import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.licensing.License;
import com.groupdocs.conversion.options.convert.ConvertOptions;
public class ConvertODTtoJPGusingJava {
public static void main(String[] args) {
// Set License to avoid the limitations of Conversion library
License license = new License();
license.setLicense("GroupDocs.Conversion.lic");
// Import ODT document
Converter converter = new Converter("input.odt");
// Get conversion option for final output document
ConvertOptions convertoptions = converter.getPossibleConversions("jpg")
.getSource().getConvertOptions();
// Save the JPG to disk
converter.convert("result.jpg", convertoptions);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment