| @@ -53,7 +53,7 @@ public class ImgYwsqhUtil { | |||||
| Graphics g = backImg.getGraphics(); | Graphics g = backImg.getGraphics(); | ||||
| Font font = Font.createFont(Font.TRUETYPE_FONT, new ClassPathResource(fontPath).getInputStream()); | Font font = Font.createFont(Font.TRUETYPE_FONT, new ClassPathResource(fontPath).getInputStream()); | ||||
| Font fTxtBottom = font.deriveFont(Font.PLAIN, 37); | |||||
| Font fTxtBottom = font.deriveFont(Font.PLAIN, 40); | |||||
| // Font fTxtBottom = new Font("黑体", Font.PLAIN, 37); | // Font fTxtBottom = new Font("黑体", Font.PLAIN, 37); | ||||
| Color myColorTxtBottom = Color.BLACK; | Color myColorTxtBottom = Color.BLACK; | ||||
| @@ -68,22 +68,22 @@ public class ImgYwsqhUtil { | |||||
| contact_name = contact_name.replace("", " ").trim(); | contact_name = contact_name.replace("", " ").trim(); | ||||
| } | } | ||||
| int xName = 1496 - metrics.stringWidth(contact_name)/2 ; | int xName = 1496 - metrics.stringWidth(contact_name)/2 ; | ||||
| g.drawString(contact_name, xName , 652);//g.drawString(文字, x 位置, y 位置); | |||||
| g.drawString(contact_name, xName , 654);//g.drawString(文字, x 位置, y 位置); | |||||
| } | } | ||||
| //图片加身份证号 | //图片加身份证号 | ||||
| if(StringUtils.isNotBlank(contact_id_number)){ | if(StringUtils.isNotBlank(contact_id_number)){ | ||||
| int xNumber = 605 - metrics.stringWidth(contact_id_number) / 2; | int xNumber = 605 - metrics.stringWidth(contact_id_number) / 2; | ||||
| g.drawString(contact_id_number, xNumber, 762); | |||||
| g.drawString(contact_id_number, xNumber, 764); | |||||
| } | } | ||||
| //图片加部门 | //图片加部门 | ||||
| if(StringUtils.isNotBlank(contact_department)){ | if(StringUtils.isNotBlank(contact_department)){ | ||||
| int xDepartment = 1180 - metrics.stringWidth(contact_department) / 2; | int xDepartment = 1180 - metrics.stringWidth(contact_department) / 2; | ||||
| g.drawString(contact_department, xDepartment, 762); | |||||
| g.drawString(contact_department, xDepartment, 764); | |||||
| } | } | ||||
| //图片加职务 | //图片加职务 | ||||
| if(StringUtils.isNotBlank(contact_job)){ | if(StringUtils.isNotBlank(contact_job)){ | ||||
| int xJob = 1562 - metrics.stringWidth(contact_job) / 2; | int xJob = 1562 - metrics.stringWidth(contact_job) / 2; | ||||
| g.drawString(contact_job, xJob, 762); | |||||
| g.drawString(contact_job, xJob, 764); | |||||
| } | } | ||||
| //图片加法人姓名 | //图片加法人姓名 | ||||
| if(StringUtils.isNotBlank(legal_person)){ | if(StringUtils.isNotBlank(legal_person)){ | ||||
| @@ -110,7 +110,7 @@ public class ImgYwsqhUtil { | |||||
| if(!isSeal){ | if(!isSeal){ | ||||
| Color sealColor = Color.LIGHT_GRAY; | Color sealColor = Color.LIGHT_GRAY; | ||||
| g.setColor(sealColor); | g.setColor(sealColor); | ||||
| g.drawString("无公章", 1214, 2192); | |||||
| g.drawString("无公章", 1214, 2194); | |||||
| } | } | ||||
| //调这个方法就是开始这个整合 (可以多张图片,多个文字整合成一张图片,只有把他们放在这方法里面就行) | //调这个方法就是开始这个整合 (可以多张图片,多个文字整合成一张图片,只有把他们放在这方法里面就行) | ||||