Hello,
I have a docx document just.zip (19.5 KB): when I convert it to HTML and then reconvert the HTML to docx again, I got a lot of harmful indentation near the list items (different from the original doc)
Here is the code used to do the double conversion (docx -> html, html -> docx):
public class ConvertDocumentToHtmlWithRoundtrip {
private static final String LICENSE = "Aspose.Words.lic";
public static final String INPUT = "%s.docx";
public static final String OUTPUT = "%s-out.docx";
public static final String HTML = "%s.html";
public static void main(String[] args) throws Exception {
//ExStart:ConvertDocumentToHtmlWithRoundtrip
// The path to the documents directory.
String dataDir = Utils.getDataDir(ConvertDocumentToHtmlWithRoundtrip.class);
String name = "just";
// Load the document.
Document doc = new Document(dataDir + String.format(INPUT, name));
HtmlSaveOptions options = new HtmlSaveOptions();
options.setExportRoundtripInformation(true);
options.setExportListLabels(ExportListLabels.BY_HTML_TAGS);
doc.save(dataDir + String.format(HTML, name), options);
doc = new Document(dataDir + String.format(HTML, name));
//Save the document Docx file format
doc.save(dataDir + String.format(OUTPUT, name), SaveFormat.DOCX);
//ExEnd:ConvertDocumentToHtmlWithRoundtrip
System.out.println("Document converted to html with roundtrip informations successfully.");
}
}