|
|
@@ -293,47 +293,52 @@ public class PdfUtil {
|
|
|
//证件图片
|
|
|
createPDFCell(tableFont, table, "证件图片", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
//证件图片 图片填充
|
|
|
- final PdfPTable imageTable1 = getImage((List<String>) data.get("imageFile"), 2, 148, 108, 2);
|
|
|
+ final PdfPTable imageTable1 = getImage((List<String>) data.get("imageFile"), 2, 190, 130, 2);
|
|
|
final PdfPCell cell1 = new PdfPCell();
|
|
|
cell1.setNoWrap(false);
|
|
|
- cell1.setPaddingLeft(8f);
|
|
|
- cell1.setPaddingRight(8f);
|
|
|
- cell1.setPaddingBottom(8f);
|
|
|
- cell1.setPaddingTop(8f);
|
|
|
+ cell1.setPaddingLeft(4f);
|
|
|
+ cell1.setPaddingRight(4f);
|
|
|
+ cell1.setPaddingBottom(4f);
|
|
|
+ cell1.setPaddingTop(4f);
|
|
|
cell1.setColspan(5);
|
|
|
cell1.setRowspan(1);
|
|
|
//cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
|
|
|
cell1.addElement(imageTable1);
|
|
|
table.addCell(cell1);
|
|
|
- createPDFCell(tableFont, table, "介绍信附件", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
- final PdfPTable imageTable2 = getImage((List<String>) data.get("file"), 2, 148, 148, 2);
|
|
|
- final PdfPCell cell2 = new PdfPCell();
|
|
|
- cell2.setNoWrap(false);
|
|
|
- cell2.setPaddingLeft(8f);
|
|
|
- cell2.setPaddingRight(8f);
|
|
|
- cell2.setPaddingBottom(8f);
|
|
|
- cell2.setPaddingTop(8f);
|
|
|
- cell2.setColspan(5);
|
|
|
- cell2.setRowspan(1);
|
|
|
- //cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
|
|
|
- cell2.addElement(imageTable2);
|
|
|
- table.addCell(cell2);
|
|
|
+
|
|
|
createPDFCell(tableFont, table, "身份核验材料", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
- final PdfPTable imageTable3 = getImage((List<String>) data.get("checkImage"), 2, 148, 148, 2);
|
|
|
+ final PdfPTable imageTable3 = getImage((List<String>) data.get("checkImage"), 2, 190, 190, 2);
|
|
|
final PdfPCell cell3 = new PdfPCell();
|
|
|
cell3.setNoWrap(false);
|
|
|
- cell3.setPaddingLeft(8f);
|
|
|
- cell3.setPaddingRight(8f);
|
|
|
- cell3.setPaddingBottom(8f);
|
|
|
- cell3.setPaddingTop(8f);
|
|
|
+ cell3.setPaddingLeft(4f);
|
|
|
+ cell3.setPaddingRight(4f);
|
|
|
+ cell3.setPaddingBottom(4f);
|
|
|
+ cell3.setPaddingTop(4f);
|
|
|
cell3.setColspan(5);
|
|
|
cell3.setRowspan(1);
|
|
|
//cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
|
|
|
cell3.addElement(imageTable3);
|
|
|
table.addCell(cell3);
|
|
|
|
|
|
-
|
|
|
document.add(table);
|
|
|
+
|
|
|
+ PdfPTable innerTable = new PdfPTable(6);
|
|
|
+ createPDFCell(tableFont, innerTable, "介绍信附件", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+
|
|
|
+// createPDFCell(tableFont, table, "介绍信附件", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ final PdfPTable imageTable2 = getImage((List<String>) data.get("file"), 2, 380, 320, 1);
|
|
|
+ final PdfPCell cell2 = new PdfPCell();
|
|
|
+ cell2.setNoWrap(false);
|
|
|
+ cell2.setPaddingLeft(4f);
|
|
|
+ cell2.setPaddingRight(4f);
|
|
|
+ cell2.setPaddingBottom(4f);
|
|
|
+ cell2.setPaddingTop(4f);
|
|
|
+ cell2.setColspan(5);
|
|
|
+ cell2.setRowspan(1);
|
|
|
+ cell2.addElement(imageTable2);
|
|
|
+ innerTable.addCell(cell2);
|
|
|
+ document.newPage();
|
|
|
+ document.add(innerTable);
|
|
|
}
|
|
|
|
|
|
public static void dealDrillBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
|
|
|
@@ -444,12 +449,12 @@ public class PdfUtil {
|
|
|
table.addCell(outCell);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private static PdfPTable getImage(List<String> images, int totalImages, float imageWidth, float imageHeight, Integer ImageNumsOfRow) throws Exception {
|
|
|
if (images == null) {
|
|
|
images = new ArrayList<>();
|
|
|
}
|
|
|
PdfPTable innerTable = new PdfPTable(ImageNumsOfRow);
|
|
|
+ innerTable.setWidthPercentage(100f);
|
|
|
innerTable.setSplitRows(true);
|
|
|
innerTable.setSplitLate(false);
|
|
|
//这里根据实际图片数量来判断是否需要补充白色图片,保证每行显示3张图片,用以填充空白
|
|
|
@@ -486,6 +491,7 @@ public class PdfUtil {
|
|
|
outerTable.setSplitRows(true);
|
|
|
outerTable.setSplitLate(false);
|
|
|
outerTable.addCell(innerCell);
|
|
|
+ outerTable.setWidthPercentage(100f);
|
|
|
return outerTable;
|
|
|
}
|
|
|
|