Applying style to div having a class name iTextSharp
问题 i have defined my html string as: string html = @" <html><body> <div class='class1'>My Text</div> </body></html> "; To apply style, I am doing this StyleSheet style = new StyleSheet(); style.LoadTagStyle("class1", HtmlTags.FACE , "PATH" + "CustomFont.ttf"); This does not work. However, using this applies the font: style.LoadTagStyle(HtmlTags.DIV, HtmlTags.FACE , "PATH"+"CustomFont.ttf"); How to specify style to a particular class? I am generating pdf using iTextSharp dll. 回答1: You need to