`
chenlb
  • 浏览: 690057 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

itest生成pdf中文为空白

阅读更多

要下载iTextAsian.jar

地址: http://prdownloads.sourceforge.net/<wbr>itext/iTextAsian.jar?download</wbr>

import com.lowagie.text.Font;
import com.lowagie.text.pdf.BaseFont;


BaseFont bfChinese = BaseFont.createFont("STSong-Light",  "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
Font FontChinese = new Font(bfChinese, 12, Font.NORMAL);

加入document:

Paragraph chunk = new Paragraph("中文", FontChinese);
document.add(chunk);

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics