Hi!
We have found an issue when inserting a hyperlink into word document and then saving it as HTML. Some style values are not applied to the final hyperlink in HTML.
Here is sample app: WordTest.zip (19.7 KB)
To reproduce the problem:
- Open project in VisualStudio
- Run the app. Select destination folder and press a button.
- In the destination folder you’ll see two html files:
3a. asposeGood.html - this is correct file. Hyperlinks are green with Comic Sans font applied.
3b. asposeWrong.html - here you can see that created hyperlinks have wrong font.
The word document attached to the application has a style for hyperlinks - they should be green with Comic Sans font.
However, when I use this code:
builder.Font.StyleIdentifier = StyleIdentifier.Hyperlink;
builder.InsertHyperlink(text, tag, false);
Then I can see that my hyperlink gets every setting from Word’s style except font name.
So when I use:
builder.PushFont();
builder.Font.StyleIdentifier = StyleIdentifier.Hyperlink;
var style = builder.Document.Styles[“Hyperlink”];
builder.Font.Name = style.Font.Name;
builder.InsertHyperlink(text, tag, false);
builder.PopFont();
Then my final hyperlink is styled correctly.
Style for those hyperlinks is created in word document.
Please, let me know if you need some more information.
Thanks!