Convert to Html
GroupDocs.Conversion can convert any source document to a markup format which in general is a HTML conformable format. You can control either to generate fixed positioned DOM elements or flow positioned DOM elements.
Conversion to markup format could be triggered by following below steps:
- Create new instance of Converter class and pass source document path as a constructor parameter;
- Instantiate MarkupConvertOptions class;
- Call convert method of Converter class instance and pass filename for the converted document and the instance of MarkupConvertOptions from the previous step.
The following code show how to convert any document to HTML.
String outputFile = "ConvertToHtml.html";
Converter converter = new Converter("sample.docx");
MarkupConvertOptions options = new MarkupConvertOptions();
converter.convert(outputFile, options);
System.out.print("\nConversion to html completed successfully. \nCheck output in " + outputFile);