您的位置:首页 > 其它

VLAN之access,trunk,hybrid三种模式区别

2015-07-16 16:04 465 查看
//创建一个文档对象
Document doc = new Document();
try {
//定义输出文件的位置
PdfWriter.getInstance(doc, new FileOutputStream("c:/hello.pdf"));
//开启文档
doc.open();
//设定字体 为的是支持中文
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
Font FontChinese = new Font(bfChinese, 12, Font.NORMAL);
//向文档中加入文字
doc.add(new Paragraph("Hello你好!世界world",FontChinese));
//关闭文档并释放资源
doc.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (DocumentException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: