Itext生成PDF的问题,表格和图片错位重叠

anchoret 2008-01-08 06:47:39
RT,
不知道怎么解决,让表格和图片能顺序的正常显示
...全文
740 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
benniaopiaoling 2009-05-27
  • 打赏
  • 举报
回复
有这种问题?
ExportExcel exportExcel1 = new ExportExcel();
String imgPath1 = exportExcel1.getExcelFilePath(null);
Image img1 = Image.getInstance(imgPath1);
img1.setAlignment(Image.ALIGN_CENTER);
Table t15 = new Table(1);
t15.setWidth(100);
t15.setPadding(30);
cell = new Cell(new Chunk(
" 四、工作条件和工作保障 \n申请人所在单位情况(包括已经具备的工作条件等);课题组织机制设计;产学研结合及工作开展设想等。\n\n"
+ CommFunc.converInput(companyinfo.getWorkcondition()),
PDFChineseFont.createChineseFont(9, Font.NORMAL)));
cell.add(img1);
t15.addCell(cell);
document.add(t15);
这是我以前项目的内容,希望对你们有帮助
living_hua 2009-05-25
  • 打赏
  • 举报
回复
我也遇到这个问题,表格里的内容和表格线重叠,无解,那位高手指导一下,谢谢啦
mumasgw 2008-07-02
  • 打赏
  • 举报
回复
这个问题我也想知道
goodmrning 2008-01-16
  • 打赏
  • 举报
回复
关注
zhb_821012 2008-01-09
  • 打赏
  • 举报
回复
没弄过这个
帮顶吧
anchoret 2008-01-09
  • 打赏
  • 举报
回复
多谢楼上,不过我还是不太明白.我的代码大致如下:

Document document = new Document(PageSize.A4, 20, 20, 20, 20);
String fileFullName = .....;
PdfWriter.getInstance(document, new FileOutputStream(fileFullName));
document.open();

for(int i = 0;i < N;i ++){
Table tabData = new Table(4);
......
document.add(tabData);
Table tabImage = new Table(1);
Image image = Image.getInstance(imageUrl);
Cell imgCell = new Cell(image);
tabImage.addCell(imgCell);
document.add(tabImage);
}
老紫竹 2008-01-08
  • 打赏
  • 举报
回复
1 放在不同的区域
2 子查询

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧