i'm having some troubles to aplly a Style in a Paragraph.
Before I add a style, I'm appending a HTML for my texts, but, sometimes, the style doesn't work well.
This is my paragraph style
- Code: Select all
ParagraphStyle style1 = new ParagraphStyle(document);
style1.Name = "StyleName";
style1.CharacterFormat.FontName = "Gotham Book";
style1.CharacterFormat.FontSize = 12;
document.Styles.Add(style1);
And this is my code
- Code: Select all
Paragraph.AppendHTML(myHtmlText);
Paragraph.ApplyStyle("StyleName");
I detected this is happening after I add a Image.
FontSize isn't working, but probably it's because when the Word read the Html, the tags have their own attributes like <h2> (but that isnt a problem, because he need to respect this).
But like I said, when I insert a image by a HTML, the text after that image will not take the Paragraph Style attributes.
Some ideas how to fix it?
I just need to apply the Font Family to be honest