LoadTagStyle不适用于使用times-new罗马字体的标记体我想在他的pdf文档中生成一个html页面。我有新罗马字体我试图设置字体时间新罗马,但他的不工作
我试过几个案例:
var styles = new StyleSheet();
1. styles.LoadTagStyle("body", "font-family", "times new roman");
2. styles.LoadTagStyle("body", "face", "times new roman");
3. styles.LoadTagStyle(HtmlTags.BODY, "face", "times new roman");
4. styles.LoadTagStyle(HtmlTags.BODY, HtmlTags.FONT, "times new roman");
但这些例子都不起的作用
我也试过:
FontFactory.RegisterDirectories();
和
FontFactory.Register(FULL_PATH_TO_TIMES_NEW_ROMAN);
和
style.LoadTagStyle(HtmlTags.TABLE, HtmlTags.FACE, "times-roman");
生成的文本没有变音符号一些建议?
这段代码解决了我的问题
FontFactory.Register("c:\windows\fonts\times.ttf");
StyleSheet st = new StyleSheet();
st.LoadTagStyle(HtmlTags.TABLE, "border", "1");
st.LoadTagStyle("body", "face", "times new roman");
st.LoadTagStyle("body", "encoding", "Identity-H");
我试过这个Itz WorkingJst试试看。
FontFactory.RegisterDirectories()
样式。LoadTagStyle(HtmlTags.TABLE、HtmlTags.FONT、"comic sans-ms");