[英]How to display “Times new roman” font for Romanian language in pdf using iTextSharp
LoadTagStyle不適用於帶有新羅馬字體的標簽主體,我想在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 Working Jst試試。
FontFactory.RegisterDirectories();
styles.LoadTagStyle(HtmlTags.TABLE, HtmlTags.FONT, "comic-sans-ms");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.