diff --git a/src/main/java/com/dpkj/modules/autoReplyPrint/service/impl/TemplateService.java b/src/main/java/com/dpkj/modules/autoReplyPrint/service/impl/TemplateService.java index 783e770..8c5b077 100644 --- a/src/main/java/com/dpkj/modules/autoReplyPrint/service/impl/TemplateService.java +++ b/src/main/java/com/dpkj/modules/autoReplyPrint/service/impl/TemplateService.java @@ -271,6 +271,10 @@ public class TemplateService { sharedContext.setInteractive(false); sharedContext.setDPI(256f); + // 使用系统默认字体,假设系统默认字体支持UTF - 8 + Font font = new Font(Font.DIALOG, Font.PLAIN, 20); + graphics.setFont(font); + // 使用Dimension对象进行布局 renderer.layout(graphics, dimension); renderer.render(graphics); diff --git a/src/main/java/com/dpkj/modules/autoReplyPrint/service/impl/USBImagePrintServiceImpl.java b/src/main/java/com/dpkj/modules/autoReplyPrint/service/impl/USBImagePrintServiceImpl.java index 6c69750..b9f2038 100644 --- a/src/main/java/com/dpkj/modules/autoReplyPrint/service/impl/USBImagePrintServiceImpl.java +++ b/src/main/java/com/dpkj/modules/autoReplyPrint/service/impl/USBImagePrintServiceImpl.java @@ -24,7 +24,11 @@ public class USBImagePrintServiceImpl extends BaseImagePrint implements ImagePri @Override public Pointer getHandle(String devName) { try { - return AutoReplyPrint.INSTANCE.CP_Port_OpenUsb(devName, 1); + Pointer pointer = AutoReplyPrint.INSTANCE.CP_Port_OpenUsb(devName, 1); + if ( pointer == null ){ + throw new RRException(); + } + return pointer; }catch (Exception e){ e.printStackTrace(); throw new RRException("获取USB句柄失败"); diff --git a/src/main/resources/templates/hospital.html b/src/main/resources/templates/hospital.html index 9af1b07..8a15663 100644 --- a/src/main/resources/templates/hospital.html +++ b/src/main/resources/templates/hospital.html @@ -4,37 +4,37 @@ 挂号单 -
-
-
-
********
-
---------------------------------------------------------------------
-
-
---------------------------------------------------------------------
+
+
+
+
********
+
-----------------------------------------------------------------------------
+
+
-----------------------------------------------------------------------------
-
-
姓  名:
-
性  别:
-
年  龄:
-
出生日期:
-
卡  号:
-
门 诊 号:
-
就诊科室:
-
出诊级别:
-
就诊医生:
-
号  序:
-
挂号日期:
-
总 费 用:
-
支付方式:
-
订 单 号:
-
交易流水:
- QR Code +
+
姓  名:
+
性  别:
+
年  龄:
+
出生日期:
+
卡  号:
+
门 诊 号:
+
就诊科室:
+
出诊级别:
+
就诊医生:
+
号  序:
+
挂号日期:
+
总费用: 元
+
支付方式:
+
订 单 号:
+
交易流水:
+ QR Code
-
---------------------------------------------------------------------
-
备注(REFERENCE):凭此条退费,请妥善保管!
-
终 端 号:
-
打印时间:
+
-----------------------------------------------------------------------------
+
备注(REFERENCE):凭此条退费,请妥善保管!
+
终 端 号:
+
打印时间: