XHTML/Markup conversion support?

Hi there,


I am looking at an alternative solution to docx4j. Docx4j has a insertHTML extension that facilitates conversion of XHTML to WordML. This allows for XHTML content to be formatted using styles defined within the Word template used for document conversion.

For example, if I insert some XHTML content:

This is the brown fox.”,


The p block inserted into the Word document at generation time would be styled normally (e.g. Word style = Normal), but the word brown would be adjusted using the “BrownText” style (also defined in Word). Is something like this possible? Would Aspose have an alternative approach to this?

Also, if referencing styles via XHTML is supported, does this include referencing table styles?

Many thanks,
Dave.

Hi Dave,


Thanks for your interest in Aspose.Words for Java.

You can insert html in Word document using DocumentBuilder.InsertHtml(String) method. After that you can save final output to WordML format using the Document.Save method. Secondly, yes Aspose.Words can import from “class” attribute on HTML “paragraph” and “span” elements. Please refer to the following article:
http://www.aspose.com/docs/display/wordsjava/Style+Features+Supported+on+HTML+Import

Please let me know if I can be of any further assistance.

Best regards,

Hi Awais,


Excellent, thanks for the feedback.

It mentions that list and table styles are planned. Do you have any info on when that will be available? If not soon, is this something that could be supported? (i.e. paid development).

Many thanks,
Dave.

Hi Dave,


Thanks for your inquiry. We are striving hard to implement these new features in Aspose.Words API but unfortunately can’t provide you any reliable estimate at the moment. In general, Aspose.Words mimics the behavior of Microsoft Word when importing/exporting a HTML file. Please let us know if you have any troubles during importing HTML file and we will be glad to look into this further for you.

Best regards,