Last active
April 14, 2022 13:17
-
-
Save groupdocs-com-kb/18134395f325905fe5c447bd5685afa8 to your computer and use it in GitHub Desktop.
How to Convert HTML to Word using Java. For more information, please follow link: https://kb.groupdocs.com/conversion/java/how-to-convert-html-to-word-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.WordProcessingConvertOptions; | |
public class ConvertHtmlToWordUsingJava { | |
public static void main(String[] args) { // Main function to convert HTML to Word in Java | |
// Remove the watermark in output Word document by adding license | |
License lic = new License(); | |
lic.setLicense("GroupDocs.Conversion.lic"); | |
// Load the source HTML file for conversion to DOCX | |
Converter converter = new Converter("sample.html"); | |
// Set the convert options for Word document | |
WordProcessingConvertOptions options = new WordProcessingConvertOptions(); | |
// Convert and save the HTML in DOCX format | |
converter.convert("converted.docx", options); | |
System.out.println("Done"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment