itext中文問題

2021-08-30 20:36:26 字數 380 閱讀 7597

因為專案需要生成pdf,小用了一下itext

發現無法輸出中文,研究了一下

font fontchinese = null;

basefont bfchinese = basefont.createfont("stsong-light", "unigb-ucs2-h", basefont.not_embedded);

fontchinese = new font(bfchinese, 12, font.normal);

看到stsong-light挺奇怪的的,

原來stsong-light,adobesongstd-light-acro,及stsongstd-light-acro三種簡體中文本型。是acrobat的簡體中文標準字型

引用

itext中文問題

因為專案需要生成pdf,小用了一下itext 發現無法輸出中文,研究了一下 font fontchinese null basefont bfchinese basefont.createfont stsong light unigb ucs2 h basefont.not embedded fon...

itext匯出中文

最近乙個專案需要匯出pdf文件,選擇使用了itext 在網上查詢,有三種方式 1 使用itextasian.jar中的字型 basefont.createfont stsong light unigb ucs2 h basefont.not embedded 2 使用windows系統字型 true...

itext中文字的絕對位置放置

itext中 可以使用 table.writeselectedrows 0,1,x,y,writer.getdirectcontent 來實現絕對位置放置。那文字段落呢.當我們不需要itext對每個單詞 句子 段落實現自動格式的時候,或是想使用特殊布局,就可以使用pdfcontentbyte來實現絕...