Styles are reset after calling "DocumentBuilder.insertHtml(html)"

Hi,

We have a template word document that is empty but that has specific styles set for the headings. For instance, for “Heading 1” the font size is 12.

The problem is that if the method “DocumentBuilder.insertHtml(html)” is called, all the styles from the template document are lost:

…
// builder.getDocument().getStyles().get("Heading 1").getFont().getSize() -> returns 12
builder.insetHtml(text);
// builder.getDocument().getStyles().get("Heading 1").getFont().getSize() -> returns 24
…

This problem occurs in version 14.2.0, but not in 13.7.0 that we were previously using.

Thanks in advance.

Hi there,

Thanks for your inquiry. We had already logged this issue as WORDSNET-9320 (InsertHtml method changes formatting of Heading styles) in our issue tracking system. Actually this is a missing feature. While using InsertHtml method there is no control over merging of styles of the HTML fragment and the target document.

You will be notified via this forum thread once this feature is available. We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-9320) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)