JAVA table对象 如何给它加个水印 RT! 公司丢给我一大难题。 求帮助阿。Table dataTable = null;。。//下面是一堆往里面加东西的代码,如果设置这个table对象水印。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 com.lowagie.text.Table; 这个包里面得。 ...背景图被 还能是啥 你的类是你自己定义的吧 能不能透露些实现让我们知道你是基于什么类写的Table呢? public static void addContentRouteDetail(Document doc, Map routesheet) { int headerBox[] = { 80, 20 }; Table dataTable = null; Cell cell = null; try { RouteList routeInfo = null; ArrayList routePus = null; PublicMethods methods = new PublicMethods(); routeInfo = (RouteList) routesheet.get("routeBasicInfo"); routePus = (ArrayList) routesheet.get("routePus"); dataTable = CommonBlock.createTable(headerBox.length, headerBox, Element.ALIGN_LEFT); cell = new Cell(new Phrase("路单编号:" + routeInfo.getBsid() + " " + "V" + routeInfo.getVersion(), CommonFont.fChs[1][8])); cell.setColspan(2); cell.setBorderColor(Color.white); dataTable.addCell(cell); cell = new Cell(new Phrase("日期:" + routeInfo.getBegindate(), CommonFont.fChs[1][8])); cell.setBorderColor(Color.white); dataTable.addCell(cell); cell = new Cell(new Phrase("车型:" + routeInfo.getTrucktype(), CommonFont.fChs[1][8])); cell.setBorderColor(Color.white); dataTable.addCell(cell); cell = new Cell(new Phrase("卡车编号:" + routeInfo.getTruckid(), CommonFont.fChs[1][8])); cell.setBorderColor(Color.white); dataTable.addCell(cell); cell = new Cell(new Phrase("长:" + routeInfo.getTrucklen() + methods.fillChar("", 2, " ") + "宽:" + routeInfo.getTruckwth(), CommonFont.fChs[1][8])); cell.setBorderColor(Color.white); dataTable.addCell(cell); cell = new Cell(new Phrase("", CommonFont.fChs[1][8])); cell.setBorderColor(Color.white); dataTable.addCell(cell); cell = new Cell(new Phrase("高:" + routeInfo.getTruckhgt() + methods.fillChar("", 2, " ") + "载重量:" + routeInfo.getTruckload(), CommonFont.fChs[1][8])); cell.setBorderColor(Color.white); dataTable.addCell(cell); dataTable.setBorderColor(Color.white); doc.add(dataTable); CommonBlock.addLogo(doc); CommonBlock.addBookSheetBarcode(doc,routeInfo.getBsid()); // 签名 CommonBlock.addSpacing(doc, "", -15, CommonFont.fChs[0][8]); CommonBlock.routeSignature(doc,routeInfo); // 汇总 CommonBlock.addSpacing(doc, "", -20, CommonFont.fChs[0][8]); CommonBlock.routeTotal(doc, routeInfo); // 公里数记录 CommonBlock.addSpacing(doc, "", -25, CommonFont.fChs[0][8]); CommonBlock.mileNote(doc); // routeDetail CommonBlock.addSpacing(doc, "", -25, CommonFont.fChs[0][8]); CommonBlock.routeDetail(doc, routePus); // 备注 CommonBlock.addSpacing(doc, "", -25, CommonFont.fChs[0][8]); CommonBlock.routeRe(doc, routeInfo); } catch (Exception ex) { ex.printStackTrace(); } }就是输出到PDF里面 需求是 在这个位置加个水印的效果 引入的IText.jar 这个包 .......误会我的意思了 我是说你现在用的Table类是基于什么东西实现的.. oracle的数据备份与恢复..急求答案,各位多多发言,谢谢 上传文件过程中怎么取消上传 如何自动触发下拉菜单 传给连接 java 工程师招聘 ResultSet如何遍历表结构未知的表? 一个JSP用户退出的问题 我想实现这样的功能 救命啊!我无意中写除了一个,能够挤暴你硬盘的jsp,大家有兴趣来研究研究吧 财付通接口,回调(payReturnUrl)时传递过来的签名和本地生成的不匹配 在sb.append中怎么编写dtree.add语句 求助JSP+在页面文本框内显示数据时,数据库里的字符数据 等怎么转换成空格等? java代码中如何判断weblogic正常启动
int headerBox[] = { 80, 20 };
Table dataTable = null;
Cell cell = null; try {
RouteList routeInfo = null;
ArrayList routePus = null;
PublicMethods methods = new PublicMethods();
routeInfo = (RouteList) routesheet.get("routeBasicInfo");
routePus = (ArrayList) routesheet.get("routePus");
dataTable = CommonBlock.createTable(headerBox.length, headerBox,
Element.ALIGN_LEFT);
cell = new Cell(new Phrase("路单编号:" + routeInfo.getBsid() + " "
+ "V" + routeInfo.getVersion(), CommonFont.fChs[1][8]));
cell.setColspan(2);
cell.setBorderColor(Color.white);
dataTable.addCell(cell);
cell = new Cell(new Phrase("日期:" + routeInfo.getBegindate(),
CommonFont.fChs[1][8]));
cell.setBorderColor(Color.white);
dataTable.addCell(cell);
cell = new Cell(new Phrase("车型:" + routeInfo.getTrucktype(),
CommonFont.fChs[1][8]));
cell.setBorderColor(Color.white);
dataTable.addCell(cell);
cell = new Cell(new Phrase("卡车编号:" + routeInfo.getTruckid(),
CommonFont.fChs[1][8]));
cell.setBorderColor(Color.white);
dataTable.addCell(cell);
cell = new Cell(new Phrase("长:" + routeInfo.getTrucklen()
+ methods.fillChar("", 2, " ") + "宽:"
+ routeInfo.getTruckwth(), CommonFont.fChs[1][8]));
cell.setBorderColor(Color.white);
dataTable.addCell(cell);
cell = new Cell(new Phrase("", CommonFont.fChs[1][8]));
cell.setBorderColor(Color.white);
dataTable.addCell(cell);
cell = new Cell(new Phrase("高:" + routeInfo.getTruckhgt()
+ methods.fillChar("", 2, " ") + "载重量:"
+ routeInfo.getTruckload(), CommonFont.fChs[1][8]));
cell.setBorderColor(Color.white);
dataTable.addCell(cell);
dataTable.setBorderColor(Color.white);
doc.add(dataTable); CommonBlock.addLogo(doc);
CommonBlock.addBookSheetBarcode(doc,routeInfo.getBsid()); // 签名
CommonBlock.addSpacing(doc, "", -15, CommonFont.fChs[0][8]);
CommonBlock.routeSignature(doc,routeInfo); // 汇总
CommonBlock.addSpacing(doc, "", -20, CommonFont.fChs[0][8]);
CommonBlock.routeTotal(doc, routeInfo); // 公里数记录
CommonBlock.addSpacing(doc, "", -25, CommonFont.fChs[0][8]);
CommonBlock.mileNote(doc); // routeDetail
CommonBlock.addSpacing(doc, "", -25, CommonFont.fChs[0][8]);
CommonBlock.routeDetail(doc, routePus);
// 备注
CommonBlock.addSpacing(doc, "", -25, CommonFont.fChs[0][8]);
CommonBlock.routeRe(doc, routeInfo);
} catch (Exception ex) {
ex.printStackTrace();
}
}
就是输出到PDF里面 需求是 在这个位置加个水印的效果 引入的IText.jar 这个包