|
|
@@ -76,11 +76,12 @@ public class PdfUtil {
|
|
|
if (rowspan != null && rowspan > 0) {
|
|
|
cell.setRowspan(rowspan);
|
|
|
}
|
|
|
+ cell.setPaddingTop(8f);
|
|
|
+ cell.setPaddingLeft(8f);
|
|
|
+ cell.setPaddingRight(8f);
|
|
|
+ cell.setPaddingBottom(8f);
|
|
|
if (PdfPCell.ALIGN_MIDDLE != align) {
|
|
|
cell.setHorizontalAlignment(align);
|
|
|
- cell.setPaddingLeft(8f);
|
|
|
- cell.setPaddingRight(8f);
|
|
|
- cell.setPaddingBottom(8f);
|
|
|
} else {
|
|
|
cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);//设置单元格的垂直对齐方式
|
|
|
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
@@ -145,60 +146,37 @@ public class PdfUtil {
|
|
|
|
|
|
public static void dealEduBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
|
|
|
//第一行
|
|
|
- createPDFCell(tableFont, table, "时间", Element.ALIGN_CENTER, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("time").toString(), Element.ALIGN_CENTER, 2, 1);
|
|
|
- createPDFCell(tableFont, table, "地点", Element.ALIGN_CENTER, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("address").toString(), Element.ALIGN_CENTER, 2, 1);
|
|
|
+ createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, data.get("time").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ createPDFCell(tableFont, table, "地点", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, data.get("address").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
//第二行
|
|
|
- createPDFCell(tableFont, table, "主持人", Element.ALIGN_CENTER, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("hostName").toString(), Element.ALIGN_CENTER, 2, 1);
|
|
|
- createPDFCell(tableFont, table, "记录人", Element.ALIGN_CENTER, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("recorderName").toString(), Element.ALIGN_CENTER, 2, 1);
|
|
|
+ createPDFCell(tableFont, table, "主持人", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, data.get("hostName").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ createPDFCell(tableFont, table, "记录人", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, data.get("recorderName").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+
|
|
|
//内容
|
|
|
- PdfPCell contentCell = new PdfPCell();
|
|
|
- contentCell.setColspan(6);
|
|
|
- Paragraph content = new Paragraph();
|
|
|
- String text = data.get("content").toString();
|
|
|
- content.add(new Chunk(text, tableFont));
|
|
|
- contentCell.addElement(content);
|
|
|
- contentCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
|
|
|
- table.addCell(contentCell);
|
|
|
- table.setSplitLate(false);
|
|
|
- table.setSplitRows(true);
|
|
|
- //总结
|
|
|
- PdfPCell noteCell = new PdfPCell();
|
|
|
- noteCell.setColspan(6);
|
|
|
- Paragraph paragraph = new Paragraph();
|
|
|
- String noteText = data.get("note").toString();
|
|
|
- paragraph.add(new Chunk(noteText, tableFont));
|
|
|
- noteCell.addElement(paragraph);
|
|
|
- noteCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
|
|
|
- table.addCell(noteCell);
|
|
|
- //签字区域
|
|
|
- PdfPCell signCell = new PdfPCell();
|
|
|
- signCell.setColspan(6);
|
|
|
- Paragraph signParagraph = new Paragraph();
|
|
|
- signParagraph.add(new Chunk("参会人员签字:", tableFont));
|
|
|
- signCell.addElement(signParagraph);
|
|
|
- signCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
|
|
|
- table.addCell(signCell);
|
|
|
+ final PdfPCell pCell = createPDFCell(tableFont, table, "内容", Element.ALIGN_MIDDLE, 1, 140);
|
|
|
+ pCell.setFixedHeight(100);
|
|
|
+ final PdfPCell content = createPDFCell(tableFont, table, data.get("content").toString(), Element.ALIGN_MIDDLE, 5, 140);
|
|
|
+ content.setFixedHeight(100);
|
|
|
+ createPDFCell(tableFont, table, "总结", Element.ALIGN_MIDDLE, 1, 140);
|
|
|
+ createPDFCell(tableFont, table, data.get("note").toString(), Element.ALIGN_MIDDLE, 5, 140);
|
|
|
+ createPDFCell(tableFont, table, "参会人员签字", Element.ALIGN_MIDDLE, 1, 140);
|
|
|
+ final PdfPTable imageTable = getImage((List<String>) data.get("image"), 3, 100, 100, 3);
|
|
|
//图片填充
|
|
|
- final PdfPTable imageTable = getImage((List<String>) data.get("image"), 12, 100, 100, 3);
|
|
|
final PdfPCell cell = new PdfPCell();
|
|
|
cell.setNoWrap(false);
|
|
|
cell.setPaddingLeft(8f);
|
|
|
cell.setPaddingRight(8f);
|
|
|
cell.setPaddingBottom(8f);
|
|
|
cell.setPaddingTop(8f);
|
|
|
- cell.setColspan(6);
|
|
|
+ cell.setColspan(5);
|
|
|
cell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
|
|
|
cell.addElement(imageTable);
|
|
|
table.addCell(cell);
|
|
|
|
|
|
- /* //第三行
|
|
|
- createPDFCell(tableFont, table, "参会人员签字", Element.ALIGN_CENTER, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("users").toString(), Element.ALIGN_CENTER, 5, 1);*/
|
|
|
-
|
|
|
document.add(table);
|
|
|
}
|
|
|
|
|
|
@@ -430,7 +408,7 @@ public class PdfUtil {
|
|
|
final Paragraph paragraph1 = new Paragraph(new Chunk(chunk, tableFont));
|
|
|
paragraph1.setSpacingAfter(8F);
|
|
|
outCell.addElement(paragraph1);
|
|
|
- outCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT| Rectangle.BOTTOM);
|
|
|
+ outCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
|
|
|
final int imageAddNums = imageList.size() % 3;
|
|
|
for (int i = 0; i < 3 - imageAddNums; i++) {
|
|
|
imageList.add("black.png");
|