加载中…
  
博文
标签:

it

分类: java进行中

public class CreateWordDemo {   

 public void createDocContext(String file) throws DocumentException,IOException { 

       // 设置纸张大小      

  Document document = new Document(PageSize.A4);       

// 建立一个书写器(Writer)与document对象关联,通过书写器(Writer)可以将文档写入到磁盘中        RtfWriter2.getInstance(document, new FileOutputStream(file));       

document.open();       

 // 设置中文字体       

 BaseFont bfChinese = BaseFont.createFont('STSongStd-Light',  'UniGB-UCS2-H', BaseFont.NOT_EMBEDDED);       

// 标题字体风格       

Font titleFont = new Font(bfChines

  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有