|
|
@@ -101,6 +101,29 @@ public class PdfUtil {
|
|
|
}
|
|
|
return cell;
|
|
|
}
|
|
|
+ private static PdfPCell cell(Font tableFont, String content, int align, Integer colspan, Integer rowspan, Integer paddingLeft, Integer paddingRight) {
|
|
|
+ PdfPCell cell = new PdfPCell(new Phrase(content, tableFont));
|
|
|
+ if (colspan != null && colspan > 0) {
|
|
|
+ cell.setColspan(colspan);
|
|
|
+ }
|
|
|
+ if (rowspan != null && rowspan > 0) {
|
|
|
+ cell.setRowspan(rowspan);
|
|
|
+ }
|
|
|
+ // cell.setPaddingTop(8f);
|
|
|
+ cell.setPaddingLeft(paddingLeft);
|
|
|
+ cell.setPaddingRight(paddingRight);
|
|
|
+ cell.setPaddingBottom(8f);
|
|
|
+ cell.setLeading(1F, 1.5F);
|
|
|
+ if (PdfPCell.ALIGN_MIDDLE != align) {
|
|
|
+ cell.setHorizontalAlignment(align);
|
|
|
+ } else {
|
|
|
+ //设置单元格的垂直方向对齐方式
|
|
|
+ cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
|
|
|
+ //设置单元格的水平方向对齐方式
|
|
|
+ cell.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
+ }
|
|
|
+ return cell;
|
|
|
+ }
|
|
|
|
|
|
private static PdfPCell cell(Font tableFont, String content, int align, Integer colspan, Integer rowspan, Integer lineSpacing) {
|
|
|
PdfPCell cell = new PdfPCell(new Phrase(content, tableFont));
|
|
|
@@ -665,10 +688,11 @@ public class PdfUtil {
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.getCheckTypeText(), Element.ALIGN_MIDDLE, 11, 1);
|
|
|
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查开始时间", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ //PdfUtil.createPDFCell(tableFont, table, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ table.addCell( cell(tableFont, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1,2,2));
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查结束时间", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
-
|
|
|
+ //PdfUtil.createPDFCell(tableFont, table, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ table.addCell( cell(tableFont, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1,2,2));
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查单位", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.getCheckOrgName(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_MIDDLE, 3, 1);
|