Free Support Forum - aspose.com

InsertHtml - support for Style tags?

Currenty is does not seem as if Aspose.Word supports style tags - we've had to use the older tags when formatting text. Would it be at all possible to include support for style tags ( or <A&gtWink?

The font tags work quite nicely with font names and colours, but when introducing font sizes, the results seem to be slightly unpredictable. Could you maybe suggest another way of handling font-sizes through html?

Thanks!!

Hi,

Thank you for considering Aspose.

Could you please post a fragment of HTML that doesn’t seem to work or works incorrectly? Why did you consider e.g. doesn’t work? For example, this line of code produces proper result for me:

builder.InsertHtml("<span style=“font-size: 24pt”>text

");

Hi Dmitry

Thanks for the response,

Here is the kind of html I’m trying to pass in (C#):

string html = “Some text here”;

It seems that the first time or two it is accepted, but then 3rd time I try to pass in this kind of html code, I get an error. The same happens when I use the style tag. I’ve managed to get around this for now by using the older tags.

Thanks again!!

Angela

Your HTML string works for me just fine even though it is repeated several times. So please make sure first if you use the latest version of Aspose.Word. If it doesn’t help, post more of your code and probably attach the document you insert HTML to.