LoadTagStyle does not work for tag body with times new roman font I want to generate in pdf document one html page inside his I have font times new roman I try to set font times new roman but his not work
I tried several cases:
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");
but none of these examples work
Also I tried :
FontFactory.RegisterDirectories();
and
FontFactory.Register(FULL_PATH_TO_TIMES_NEW_ROMAN);
and
style.LoadTagStyle(HtmlTags.TABLE, HtmlTags.FACE, "times-roman");
generated text is without diacritics some proposal?
This code solve my problem
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");
FontFactory.RegisterDirectories();
styles.LoadTagStyle(HtmlTags.TABLE, HtmlTags.FONT, "comic-sans-ms");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.