We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ODT export: hyperlinks not using text format

I'm finding that when converting to ODT, hyperlinks do not acquire the font styles that I apply. Below is the code:

DocumentBuilder builder = new DocumentBuilder(_toDoc);
builder.MoveTo(par);
if (run.getStyleBool(vuObj.Styles.FONTBOLD))
builder.Font.Bold = true;
if (run.getStyleBool(vuObj.Styles.FONTITALIC))
builder.Font.Italic = true;
if (run.getStyleBool(vuObj.Styles.FONTSTRIKETHROUGH))
builder.Font.StrikeThrough = true;
int color = run.getStyleInt(vuObj.Styles.FONTCOLOR);
if (color != 0 && color != vuObj.Styles.COLOR_NONE)
builder.Font.Color = Color.FromArgb(0xff, Color.FromArgb(color));
if (run.getStyleInt(vuObj.Styles.FONTBGCOLOR) != vuObj.Styles.COLOR_NONE)
{
int bgColor = run.getStyleInt(vuObj.Styles.FONTBGCOLOR);
if (bgColor != vuObj.Styles.COLOR_NONE)
builder.Font.HighlightColor = Color.FromArgb(0xff, Color.FromArgb(bgColor));
}
string fontName = mapFontName(run.getStyleString(vuObj.Styles.FONTID));
builder.Font.Name = fontName;
builder.Font.Size = HIPSToPoints(run.getStyleInt(vuObj.Styles.FONTSIZE));

builder.Font.Underline = Underline.Single; // just for hlinks

builder.InsertHyperlink(text, hLinkUrl, false);

Regards,

Steve

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I managed to reproduce the problem and created new issue #6370 in our defect database. I will notify you as soon as it is fixed.

Best regards.

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

The issue is already fixed in the current codebase. Release will be published soon. I will notify you.

Best regards.

Thank you for your prompt fix!

Steve

We are happy to tell you that we released new version of Aspose.Words. This version includes fix of issue you found earlier (issue # 6370). You can download new version from here:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

http://www.aspose.com/community/files/51/file-format-components/aspose.words/entry154627.aspx

Best regards.

I'm testing with Aspose 6.0.1. It seems that the font size is translating correctly now, but the font face still always appears as Times New Roman in the ODT document.

Regards,
Steve

Hi Steve,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I managed to reproduce the problem on my side and created new issue #7075 in our defect database. I will notify you as soon as it is fixed.

This works fine with Arial font but not with all fonts.

Best regards.

The issues you have found earlier (filed as 7075) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by alexey.noskov.