簡體   English   中英

如何使用iTextSharp在pdf中顯示羅馬尼亞語的“ Times new Roman”字體

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM