Java Itext生成doc时需要注意的问题

①:字体

 字体名称是中文的,在中间的中文字符前后加空格,  
    RtfFont font = new RtfFont("宋 体", 36, Font.BOLD, Color.BLACK); 

    RtfFont font = new RtfFont("仿 宋 GB_2312", 36, Font.BOLD, Color.BLACK); 

 

②:段落与表之间产生多余的空格

//为了解决在插入段落与表之间产生多余的空格
 document.add(new com.lowagie.text.Phrase(""));
 new com.lowagie.text.Paragraph();

 

posted on 2017-05-19 11:05  taoshao  阅读(169)  评论(0)    收藏  举报

导航