فهرست منبع

Merge remote-tracking branch 'origin/dev_v3.2.1' into dev_v3.2.1

wangliang 2 سال پیش
والد
کامیت
11736837c1

+ 10 - 8
distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/CreatePrintPdfUtil.java

@@ -152,7 +152,7 @@ public class CreatePrintPdfUtil {
             int j = 0;
             for (Map.Entry<String, String> entry : studentHeadPlate.entrySet()) {
                 headKeys[columnCount * i + j] = entry.getKey();
-                studentTable.addCell(PdfFillUtils.createCell(entry.getValue(), PdfFillUtils.textFont12, BaseColor.GRAY, 16f, Element.ALIGN_CENTER, 0, 1, 1));
+                studentTable.addCell(PdfFillUtils.createCell(entry.getValue(), PdfFillUtils.textFont12, BaseColor.LIGHT_GRAY, 16f, Element.ALIGN_CENTER, 0, 1, 1));
                 j++;
             }
         }
@@ -252,29 +252,31 @@ public class CreatePrintPdfUtil {
             Image code128Image = PdfFillUtils.createBarcode(pdfWriter, pdfPackageDto.getPackageNumber(), false, null, null);
             code128Image.scalePercent(100);
             titleTable.setPaddingTop(1);
-            titleTable.addCell(PdfFillUtils.createCell("", null, null, 40f, Element.ALIGN_CENTER, 15, 1, 1));
+            titleTable.addCell(PdfFillUtils.createCell("", null, null, 30f, Element.ALIGN_CENTER, 15, 1, 1));
             titleTable.addCell(PdfFillUtils.createCell(code128Image, 30f, Element.ALIGN_CENTER, 15, 1, 1));
 
-            titleTable.addCell(PdfFillUtils.createCell(pdfPackageDto.getTitle(), PdfFillUtils.textFont28, null, 50f, Element.ALIGN_CENTER, 15, 1, 2));
+            titleTable.addCell(PdfFillUtils.createCell(pdfPackageDto.getTitle(), PdfFillUtils.textFont22, null, 35f, Element.ALIGN_CENTER, 15, 1, 2));
 
             List<Map<String, String>> titlePlate = pdfPackageDto.getTitlePlate();
             for (Map<String, String> stringMap : titlePlate) {
                 String value = stringMap.get("value");
                 if (StringUtils.isNotBlank(value)) {
-                    titleTable.addCell(PdfFillUtils.createCell(value, PdfFillUtils.textFont18, null, 30f, Element.ALIGN_CENTER, 15, 1, 2));
+                    titleTable.addCell(PdfFillUtils.createCell(value, PdfFillUtils.textFont16, null, 30f, Element.ALIGN_CENTER, 15, 1, 2));
                 }
             }
 
             document.add(titleTable);
             document.add(blank);
+            document.add(blank);
 
             // 基础信息表格
-            PdfPTable basicTable = PdfFillUtils.createTable(new float[]{24, 3, 73});
+            PdfPTable basicTable = PdfFillUtils.createTable(new float[]{3, 15, 3, 79});
             List<Map<String, String>> basicPlate = pdfPackageDto.getBasicPlate();
             for (Map<String, String> stringMap : basicPlate) {
-                basicTable.addCell(PdfFillUtils.createCell(stringMap.get("name"), PdfFillUtils.textFont24, 50f, Element.ALIGN_JUSTIFIED_ALL, 0f));
-                basicTable.addCell(PdfFillUtils.createCell(": ", PdfFillUtils.textFont24, 50f, Element.ALIGN_JUSTIFIED_ALL, 0f));
-                basicTable.addCell(PdfFillUtils.createCell(stringMap.get("value"), PdfFillUtils.textFont24, 50f, Element.ALIGN_LEFT, 0f));
+                basicTable.addCell(PdfFillUtils.createCell("", PdfFillUtils.textFont14, 50f, Element.ALIGN_JUSTIFIED_ALL, 0f));
+                basicTable.addCell(PdfFillUtils.createCell(stringMap.get("name"), PdfFillUtils.textFont14, 50f, Element.ALIGN_JUSTIFIED_ALL, 0f));
+                basicTable.addCell(PdfFillUtils.createCell(": ", PdfFillUtils.textFont14, 50f, Element.ALIGN_JUSTIFIED_ALL, 0f));
+                basicTable.addCell(PdfFillUtils.createCell(stringMap.get("value"), PdfFillUtils.textFont14, 50f, Element.ALIGN_LEFT, 0f));
             }
             document.add(basicTable);
             document.add(blank);

+ 9 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/PdfFillUtils.java

@@ -27,7 +27,10 @@ public class PdfFillUtils {
     // 定义全局的字体静态变量
     public static Font textFont28;
     public static Font textFont24;
+    public static Font textFont22;
     public static Font textFont18;
+    public static Font textFont16;
+    public static Font textFont14;
     public static Font textFont12;
     public static Font textFont11;
     public static Font textFont10;
@@ -41,7 +44,10 @@ public class PdfFillUtils {
             BaseFont bfChinese = BaseFont.createFont(AsianFontMapper.ChineseSimplifiedFont, AsianFontMapper.ChineseSimplifiedEncoding_H, BaseFont.NOT_EMBEDDED);
             textFont28 = new Font(bfChinese, 28);
             textFont24 = new Font(bfChinese, 24);
+            textFont22 = new Font(bfChinese, 22);
             textFont18 = new Font(bfChinese, 18);
+            textFont16 = new Font(bfChinese, 16);
+            textFont14 = new Font(bfChinese, 14);
             textFont12 = new Font(bfChinese, 12);
             textFont11 = new Font(bfChinese, 11);
             textFont10 = new Font(bfChinese, 10);
@@ -198,7 +204,7 @@ public class PdfFillUtils {
      */
     public static PdfPCell createCell(String value, Font font, BaseColor cellColor, float fixedHeight, int horizontalAlignment, int disableBorderSide, int rowspan, int colspan) {
         PdfPCell cell = new PdfPCell();
-        cell.setBorderWidth(0.1F);
+        cell.setBorderWidth(0.5F);
         cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
         cell.setHorizontalAlignment(horizontalAlignment);
         cell.setUseAscender(true);
@@ -234,7 +240,7 @@ public class PdfFillUtils {
      */
     public static PdfPCell createCell(String value, Font font, float fixedHeight, int horizontalAlignment, float paddingLeft) {
         PdfPCell cell = new PdfPCell();
-        cell.setBorderWidth(0.1F);
+        cell.setBorderWidth(0.5F);
         cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
         cell.setHorizontalAlignment(horizontalAlignment);
         cell.setUseAscender(true);
@@ -260,7 +266,7 @@ public class PdfFillUtils {
      */
     public static PdfPCell createCell(Image image, float fixedHeight, int horizontalAlignment, int disableBorderSide, int rowspan, int colspan) {
         PdfPCell cell = new PdfPCell(image);
-        cell.setBorderWidth(0.1F);
+        cell.setBorderWidth(0.5F);
         cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
         cell.setUseAscender(true);
         cell.setHorizontalAlignment(horizontalAlignment);