首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

IText创造斜线表格

2012-10-21 
IText创建斜线表格?/**以下的为创建交叉线*/?BaseFont bfBaseFont.createFont(C:\\WINDOWS\\Fonts\\SIMF

IText创建斜线表格

?/**以下的为创建交叉线*/

?BaseFont bf=BaseFont.createFont("C:\\WINDOWS\\Fonts\\SIMFANG.TTF",BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);
??? ?? PdfContentByte cb = writer.getDirectContent();

?cb.setFontAndSize(bf, 10.5f);
??? cb.setLineWidth(1.0f);
???/* *//**矩形的上边线*//*
??? cb.moveTo(22, 500);
??? cb.lineTo(219, 500);
??? *//**矩形的左边线*//*
??? cb.moveTo(22, 500);
??? cb.lineTo(22, 450);???
??? *//**矩形的下边线*//*
??? cb.moveTo(22, 450);
??? cb.lineTo(219, 450);
??? *//**矩形的右边线*//*
??? cb.moveTo(219, 450);
??? cb.lineTo(219, 500);*/
???
??? /**总体的线*/
??? cb.moveTo(22, 500);
??? cb.lineTo(219, 480);
??? /**年度的线*/
??? cb.moveTo(22, 500);
??? cb.lineTo(219, 450);
??? /**项目的线*/
??? cb.moveTo(22, 500);
??? cb.lineTo(100, 450);
???
???cb.stroke(); ?????????
???cb.beginText(); ????
???cb.setTextMatrix(190, 490); ????
???cb.showText("总体"); ????
????? cb.setTextMatrix(180, 470); ????
???cb.showText("年度");
???cb.setTextMatrix(120, 460);
???cb.showText("项目");
???cb.setTextMatrix(40, 460);
???cb.showText("章节");
???cb.endText(); ?

热点排行