随笔分类 -  IText

摘要:IText生成doc文档需要三个包:iTextAsian.jar,iText-rtf-2.1.4.jar,iText-2.1.4.jar亲测无误,代码如下所示:import com.lowagie.text.*;import com.lowagie.text.Font;import com.lowagie.text.Rectangle;import com.lowagie.text.pdf.BaseFont;import com.lowagie.text.pdf.PdfPCell;import com.lowagie.text.pdf.PdfPTable;import com.lowagie. 阅读全文
posted @ 2013-08-04 19:21 无忧之路 阅读(805) 评论(0) 推荐(0) 编辑
摘要:IText生成doc文档需要三个包:iTextAsian.jar,iText-rtf-2.1.4.jar,iText-2.1.4.jar亲测无误,代码如下:import com.lowagie.text.*;import com.lowagie.text.Rectangle;import com.lowagie.text.rtf.RtfWriter2;import java.io.FileOutputStream;/** * 纸张方向横向测试 * User: HYY * Date: 13-8-1 * Time: 下午9:54 * To change this template use File 阅读全文
posted @ 2013-08-04 19:17 无忧之路 阅读(919) 评论(0) 推荐(1) 编辑
摘要:昨晚寻找了网上很多关于IText表格居中问题,他们其中的有些代码我即使复制上去生成的doc表格的文字都是不居中的,后来我自己找出了一种居中方式:为PdfPCell对象添加paragraph对象,并将该paragraph设置为居中: PdfPCell cell1 = new PdfPCell(); Paragraph para = new Paragraph("该单元居中"); //设置该段落为居中显示 para.setAlignment(1); cell1.setPhrase(para); table.addCell(cell1);代码亲测无误,全部代码如下:import 阅读全文
posted @ 2013-08-04 19:14 无忧之路 阅读(18960) 评论(0) 推荐(1) 编辑
摘要:IText生成doc文档需要三个包:iTextAsian.jar,iText-rtf-2.1.4.jar,iText-2.1.4.jar亲测无误,代码如下:import com.lowagie.text.Document;import com.lowagie.text.Font;import com.lowagie.text.PageSize;import com.lowagie.text.Paragraph;import com.lowagie.text.pdf.BaseFont;import com.lowagie.text.rtf.RtfWriter2;import org.junit. 阅读全文
posted @ 2013-08-04 19:01 无忧之路 阅读(795) 评论(0) 推荐(1) 编辑
摘要:做doc文档报表的时候可能遇到这样的需求:每一个页面需要页码,用IText可以完成这样的需求。IText生成doc文档需要三个包:iTextAsian.jar,iText-rtf-2.1.4.jar,iText-2.1.4.jar代码亲测无错,如下所示:import com.lowagie.text.*;import com.lowagie.text.Font;import com.lowagie.text.rtf.RtfWriter2;import java.awt.*;import java.io.FileOutputStream;/*** 生成页脚页码* User: HYY* Date: 阅读全文
posted @ 2013-08-04 18:55 无忧之路 阅读(3979) 评论(0) 推荐(0) 编辑

无忧之路
点击右上角即可分享
微信分享提示