final DocumentBuilder builder = new DocumentBuilder(document);
builder.insertHtml(cleanHtml);
final OoxmlSaveOptions so = new OoxmlSaveOptions(SaveFormat.DOCX);
so.setUseAntiAliasing(true);
so.setUseHighQualityRendering(true);
document.save(“mydoc.docx”, so);
}
When running this code, I got a document where the word “HOHOHO” cannot be found.
This bug is a very serious issue.
If I manually remove the aspose words styles (aw-tabstop-align & aw-tabstop-pos), then my document is correct but I’m afraid of what could be the consequences of always removing those styles from the html.
Thanks for your inquiry. We have tested the scenario with your sample code and notice the reported issue. We have logged a ticket WORDSJAVA-1530 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.
As the consequences of this issue (lost content) is dramatic for me, I seriously consider to removes those styles from the html until you have a proper fix.
Can you help me to understand what could be the consequences of removing those two styles ?
Thanks for your feedback. It seems Aspose.Words is not loading Text into DOM with “display: inline-block style;”. As a workaround, you can remove this style to resolve the issue. Hopefully it will help.
However, we will keep you updated about resolution progress of above logged issue.
Thanks for your patience. We have investigated above reported issue and found it is not a bug.
The element in your document has a special format telling Aspose.Words that this is a ‘tab stop emulation’ span, as we call it. Such spans are produced by Aspose.Words in order to emulate tab stops of the source document and make round-trip of tab stops possible. When such span is imported back from HTML by Aspose.Words, its contents are ignored and a tab character is inserted into the resulting document instead.
If you need a normal span with arbitrary text then you can remove Aspose.Words’ custom CSS properties (’-aw-tabstop-align’ and ‘-aw-tabstop-pos’).