2012-07-18 197 views
0

LoadTagStyle不适用于具有时间标签主体的新罗马字体 我想在pdf文档中生成一个html页面,里面有他的字体时间new roman 我尝试设置字体宋体,但他不行如何使用iTextSharp在pdf中显示罗马尼亚语的“Times new roman”字体

我尝试了几种情况:

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"); 

生成的文本是没有变音符号 一些建议呢?

回答

0

此代码解决我的问题

  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"); 
-1

我想这伊茨工作 JST试试看。


 

FontFactory.RegisterDirectories();
styles.LoadTagStyle(HtmlTags.TABLE, HtmlTags.FONT, "comic-sans-ms");
相关问题