要下载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);
itest生成pdf中文为空白
最新推荐文章于 2022-12-27 09:10:12 发布