Last active
May 18, 2023 09:37
How to Convert RTF to HTML using Java. For more information, please follow link: https://kb.groupdocs.com/conversion/java/how-to-convert-rtf-to-html-using-java/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.groupdocs.conversion.Converter; | |
import com.groupdocs.conversion.licensing.License; | |
import com.groupdocs.conversion.options.convert.ConvertOptions; | |
public class ConvertRTFtoHTMLUsingJava { | |
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 RTF document | |
Converter converter = new Converter("input.rtf"); | |
// Get conversion option for final output document | |
ConvertOptions conversionoptions = converter.getPossibleConversions("html") | |
.getSource().getConvertOptions(); | |
// Save the HTML to disk | |
converter.convert("result.html", conversionoptions); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment