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 @@