先调用Cell.setUseAscender(true);
再调用Cell.setVerticalAlignment(Cell.ALIGN_MIDDLE);
cell.setHorizontalAlignment(Element.ALIGN_CENTER); //水平居中
cell.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直居中
iText PdfPCell内容水平垂直居中
最新推荐文章于 2022-08-10 06:57:22 发布
先调用Cell.setUseAscender(true);
再调用Cell.setVerticalAlignment(Cell.ALIGN_MIDDLE);
cell.setHorizontalAlignment(Element.ALIGN_CENTER); //水平居中
cell.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直居中