pdf 文本和图片解析iText 您所在的位置:网站首页 pdf和照片 pdf 文本和图片解析iText

pdf 文本和图片解析iText

2024-07-03 01:16| 来源: 网络整理| 查看: 265

itext pdf写入可见附件

libinqqq: 真没看懂

pdf 文本和图片解析iText

W3C_Newbie: 请问能获取页码吗

itext在pdf中画虚线

暮霭晨辰: nice,学习了

itext在pdf中画虚线

melongblood: 网上有个简单的方法,甚至不需要计算单元格的边界之类的。而且可以兼容cell.setBackgroundColor。[code=java] public class CustomCellSlant implements PdfPCellEvent { public void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[] canvases) { PdfContentByte cb = canvases[PdfPTable.LINECANVAS]; cb.saveState(); cb.setLineWidth(0.5f); cb.setLineDash(new float[] {5.0f, 0.0f}, 0); cb.moveTo(position.getLeft(), position.getTop()); cb.lineTo(position.getRight(), position.getBottom()); cb.stroke(); cb.restoreState(); } } // document.open(); CustomCellSlant slant = new CustomCellSlant(); cell = new PdfPCell(new Phrase("test")); cell.disableBorderSide(2); cell.setBackgroundColor(new BaseColor(204, 204, 204)); cell.setCellEvent(slant); table.addCell(cell); [/code]

itext在pdf中画虚线

melongblood: 已经解决了,表格中不设置背景色,而是用canvas.setRGBColorFill(red, green, blue);,就可以跟画的线不冲突了。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有