import com.groupdocs.conversion.Converter; import com.groupdocs.conversion.licensing.License; import com.groupdocs.conversion.options.convert.ConvertOptions; public class ConvertHTMLtoMHTMLUsingJava { 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 HTML document Converter converter = new Converter("input.html"); // Get conversion option for final output document ConvertOptions conversionoptions = converter.getPossibleConversions("mhtml") .getSource().getConvertOptions(); // Save the MHTML to disk converter.convert("result.mhtml", conversionoptions); } }