Free Support Forum - aspose.com

Link format changed on convert to doc to html

hi out there,
i’ve got a problem to create html results as aspected. the problem is the final html style for all the links in the original word file. i can insert the hyperlinks and set the stylesheet without any problem but if the links are already in the original document the format seems to be ignored / changed. i noticed a difference between normal links and mailto: links but in both cases the original format has changed in the final result.

if i open the word file i can see the font (tahoma) and the size (10) and on convert i get a different size and font.
mailto results in (Times New Roman - Size 12)
normal link (Verdana - Size 8)

how can this happen and what can i do to solve the problem?

(in most of the cases i will have no influence to the original doc template so i have to be shure that the convert does not change the format of the final document)

here is the final convert from db to html:

MemoryStream lMsWordStream = new MemoryStream(lTemplate.FileData);
var lDoc = new Document(lMsWordStream);
lMsWordStream.Close();

MemoryStream lHtmlStream = new MemoryStream(); lDoc.SaveOptions.HtmlExportXhtmlTransitional = true;
lDoc.Save(lHtmlStream, SaveFormat.Html);
var lHtml = Encoding.UTF8.GetString(lHtmlStream.GetBuffer());

thanks for your reply

Hi,


Could you attach the input and output documents? I would try to investigate why the issue with links happens.

Thanks.

thanks for the fast reply.

i have created a new test document to reduce the possibilities that can cause the problem. i already figured out that there is a different style in the wordfile directly behind the hyperlink (you can see it if you put the cursor right behind the link). it seems to be a default format set by word. i’m not able to really remove this part. even if word does not show this style when i save the document, it gets restored when the document was saved and reopened.

many thanks for any ideas to solve this issue

Hi

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

Thank you for additional information. I cannot reproduce the problem on my side using the latest version of Aspose.Words (9.0.0). You can download this version from here:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

Best regards,