String pdfFilePath = "f:/itext-demo.pdf";
Document document = new Document(PageSize.A4);
// 第二 步: Get a PdfWriter instance.
PdfWriter.getInstance(document, new FileOutputStream(pdfFilePath));
// 第三步:Open the Document.
\document.open();
// 添加 中文信息
BaseFont bfCN = BaseFont.createFont("STSongStd-Light",
"UniGB-UCS2-H", false);
// 设置字体大小
Font fontCN = new Font(bfCN, 12, Font.NORMAL, BaseColor.RED);
document.add(new Paragraph("使用STSongStd-Light字体输出中文。"
, fontCN));
BaseFont bfHei = BaseFont.createFont("c:\\Windows\\fonts\\SIMHEI.TTF",
BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
Font font = new Font(bfHei, 32);
String text = "这是黑体字测试!";
document.add(new Paragraph(text, font));
bfHei = BaseFont.creat