记得上下班打卡 | git大法好,push需谨慎

Commit c1024ee5 authored by jiangxiulong's avatar jiangxiulong

打印

parent 12f38f38
package com.liquidnet.client.admin.web.controller.zhengzai.kylin;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.FileInputStream;
import java.io.IOException;
import javax.print.Doc;
import javax.print.DocFlavor;
import javax.print.DocPrintJob;
import javax.print.PrintException;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.SimpleDoc;
import javax.print.attribute.DocAttributeSet;
import javax.print.attribute.HashDocAttributeSet;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Copies;
import javax.print.attribute.standard.MediaPrintableArea;
import javax.print.attribute.standard.OrientationRequested;
import javax.print.attribute.standard.PrintQuality;
/**
* <p>
* xx 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-07-05 7:50 下午
*/
public class ExpressPrintController {
private static final Logger logger = LoggerFactory.getLogger(ExpressPrintController.class);
/**
* 打印图片
*
* @param fileName
* @param count
*/
public static void drawImage(String fileName, int count) {
FileInputStream fin = null;
try {
DocFlavor dof = null;
if (fileName.endsWith(".gif")) {
dof = DocFlavor.INPUT_STREAM.GIF;
} else if (fileName.endsWith(".jpg")) {
dof = DocFlavor.INPUT_STREAM.JPEG;
} else if (fileName.endsWith(".png")) {
dof = DocFlavor.INPUT_STREAM.PNG;
}
PrintService ps = PrintServiceLookup.lookupDefaultPrintService();
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
pras.add(OrientationRequested.PORTRAIT);
pras.add(new Copies(count));
pras.add(PrintQuality.HIGH);
DocAttributeSet das = new HashDocAttributeSet();
// 设置打印纸张的大小(以毫米为单位)
das.add(new MediaPrintableArea(0, 0, 210, 296, MediaPrintableArea.MM));
fin = new FileInputStream(fileName);
Doc doc = new SimpleDoc(fin, dof, das);
DocPrintJob job = ps.createPrintJob();
job.print(doc, pras);
fin.close();
logger.info("打印成功!文件:" + fileName + "数量为:" + count);
} catch (IOException ie) {
ie.printStackTrace();
} catch (PrintException pe) {
pe.printStackTrace();
} finally {
IOUtils.closeQuietly(fin);
}
}
/**
* test
*
* @param args
*/
public static void main(String[] args) {
// 打印图片
// new ExpressPrintController().drawImage("/Users/jiangxiulong/Desktop/图片余篇图片/WX20210705-200856@2x.png", 1);
}
}
...@@ -47,6 +47,8 @@ public class CodeUtil { ...@@ -47,6 +47,8 @@ public class CodeUtil {
private static final Logger logger = LoggerFactory.getLogger(CodeUtil.class); private static final Logger logger = LoggerFactory.getLogger(CodeUtil.class);
public static String pathName = System.getProperty("user.dir").concat("/liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/admin/service/impl/utils/tmphtml/");
public static String getQRCode(String content, int width, int height) { public static String getQRCode(String content, int width, int height) {
if (!StringUtils.isEmpty(content)) { if (!StringUtils.isEmpty(content)) {
ServletOutputStream stream = null; ServletOutputStream stream = null;
...@@ -64,7 +66,7 @@ public class CodeUtil { ...@@ -64,7 +66,7 @@ public class CodeUtil {
ByteArrayOutputStream os = new ByteArrayOutputStream(); ByteArrayOutputStream os = new ByteArrayOutputStream();
// ImageIO.write(bufferedImage, "png", os); // ImageIO.write(bufferedImage, "png", os);
String htmlPath = System.getProperty("user.dir").concat("/liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/admin/service/impl/utils/tmphtml/qrcode/out.png"); String htmlPath = pathName.concat("qrcode/QRCode.png");
ImageIO.write(bufferedImage, "png", new File(htmlPath)); ImageIO.write(bufferedImage, "png", new File(htmlPath));
return htmlPath; return htmlPath;
...@@ -102,7 +104,7 @@ public class CodeUtil { ...@@ -102,7 +104,7 @@ public class CodeUtil {
ByteArrayOutputStream os = new ByteArrayOutputStream(); ByteArrayOutputStream os = new ByteArrayOutputStream();
// ImageIO.write(bufferedImage, "png", os); // ImageIO.write(bufferedImage, "png", os);
String htmlPath = System.getProperty("user.dir").concat("/liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/admin/service/impl/utils/tmphtml/qrcode/out1.png"); String htmlPath = pathName.concat("qrcode/barCode.png");
ImageIO.write(bufferedImage, "png", new File(htmlPath)); ImageIO.write(bufferedImage, "png", new File(htmlPath));
return htmlPath; return htmlPath;
...@@ -184,230 +186,236 @@ public class CodeUtil { ...@@ -184,230 +186,236 @@ public class CodeUtil {
} }
// public static void html2img(String htmlstr) // public static void html2img(String htmlstr)
public static void html2img() public static String html2img()
{ {
String qrCode = getQRCode("2453657424", 25, 25); String qrCode = getQRCode("2453657424", 25, 25);
System.out.println(qrCode);
String barCode = getBarCode("2453657424", 90, 13); String barCode = getBarCode("2453657424", 90, 13);
System.out.println(barCode);
String html = tmpHtml();
// 码图
String replace1 = html.replace("images/yiweima.png", barCode).replace("images/erweima.png", qrCode);
// 收 寄图
String replace2 = replace1.replace("images/iconJi.png", pathName.concat("images/iconJi.png"))
.replace("images/iconShou.png", pathName.concat("images/iconShou.png"));
Html2Image html2Image = Html2Image.fromHtml(replace2);
String imgPath = pathName.concat("qrcode/img.png");
String htmlPath = System.getProperty("user.dir").concat("/liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/admin/service/impl/utils/tmphtml/shunfeng1.html"); html2Image.getImageRenderer().saveImage(imgPath);
// String replaceStr = htmlPath.replace("images/yiweima.png", barCode);
// String replace = replaceStr.replace("images/erweima.png", qrCode); return imgPath;
}
public static void main(String[] args) {
String imgPath = html2img();
// 打印图片
drawImage(imgPath, 1);
}
public static String tmpHtml()
{
String html = "<!DOCTYPE html>\n" + String html = "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" + "<html style=\"width: 100mm;\" lang=\"en\">\n" +
"<head>\n" + "<head>\n" +
"\t<meta charset=\"utf-8\">\n" + " <meta charset=\"utf-8\">\n" +
"\t<meta name=\"renderer\" content=\"webkit\">\n" + " <meta name=\"renderer\" content=\"webkit\">\n" +
"\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n" + " <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n" +
"\t<meta http-equiv=\"Cache-Control\" content=\"no-transform\">\n" + " <meta http-equiv=\"Cache-Control\" content=\"no-transform\">\n" +
"\t<meta http-equiv=\"Access-Control-Allow-Origin\" content=\"*\" />\n" + " <meta http-equiv=\"Access-Control-Allow-Origin\" content=\"*\"/>\n" +
"\t<meta content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\" name=\"viewport\">\n" + " <meta content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\" name=\"viewport\">\n" +
"\t<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n" + " <meta name=\"apple-mobile-web-app-capable\" content=\"yes\"/>\n" +
"\t<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" />\n" + " <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\"/>\n" +
"\t<meta name=\"format-detection\" content=\"telephone=yes\" /><!-- 点击链接打电话 -->\n" + " <meta name=\"format-detection\" content=\"address=no\"/>\n" +
"\t<meta name=\"format-detection\" content=\"address=no\" />\n" + " <meta name=\"keywords\" content=\"\">\n" +
"\t<meta name=\"keywords\" content=\"\">\n" + " <meta name=\"description\" content=\"\">\n" +
"\t<meta name=\"description\" content=\"\">\n" +
"\t<link rel=\"icon\" type=\"image/png\" sizes=\"12x12\" href=\"https://img.zhengzai.tv/static/img/logo_small.png\">\n" +
"</head>\n" + "</head>\n" +
"<body>\n" + "<body>\n" +
"\t<!-- 顺丰快递面单打印,尺寸:100mm*150mm模版 -->\n" + "<!-- 顺丰快递面单打印,尺寸:100mm*150mm模版 -->\n" +
"\t<div\n" + "<div\n" +
"\t\tid=\"shunfeng-express\"\n" + " style=\"width: 96mm;\n" +
"\t\tstyle=\"width: 96mm;\n" +
"\t\t\theight: 150mm;\n" + "\t\t\theight: 150mm;\n" +
"\t\t\tpadding-top: 5mm;\n" + "\t\t\tpadding-top: 5mm;\n" +
"\t\t\tborder: 1px solid #000;\n" + "\t\t\tborder: 1px solid #000;\n" +
"\t\t\ttext-align: center;\"\n" + "\t\t\ttext-align: center;\"\n" +
"\t>\n" + ">\n" +
"\t\t<!-- 1. 运单打印系统来源及时间等 -->\n" + " <!-- 1. 运单打印系统来源及时间等 -->\n" +
"\t\t<div \n" + " <div\n" +
"\t\t\tclass=\"sourceAndPrintTime\"\n" + " style=\"width: 100%;\n" +
"\t\t\tstyle=\"width: 100%;\n" +
"\t\t\t\tfont-family: 宋体;\n" + "\t\t\t\tfont-family: 宋体;\n" +
"\t\t\t\tfont-size: 4pt;\n" + "\t\t\t\tfont-size: 4pt;\n" +
"\t\t\t\tdisplay: flex;\n" + "\t\t\t\tdisplay: flex;\n" +
"\t\t\t\tflex-direction: row;\n" + "\t\t\t\tflex-direction: row;\n" +
"\t\t\t\tjustify-content: space-between;\n" + "\t\t\t\tjustify-content: space-between;\n" +
"\t\t\t\talign-items: flex-end;\"\n" + "\t\t\t\talign-items: flex-end;\"\n" +
"\t\t>\n" + " >\n" +
"\t\t\t<!-- 1.1 打印系统来源(太长放不下了,所以去掉了) -->\n" + " <!-- 1.1 打印系统来源(太长放不下了,所以去掉了) -->\n" +
"\t\t\t<!-- <div class=\"source\">\n" + " <!-- <div class=\"source\">\n" +
"\t\t\t\tSCP顺丰云打印\n" + " SCP顺丰云打印\n" +
"\t\t\t</div> -->\n" + " </div> -->\n" +
"\t\t\t<!-- 1.2 打印次数/时间 -->\n" + " <!-- 1.2 打印次数/时间 -->\n" +
"\t\t\t<div\n" + " <!-- <div\n" +
"\t\t\t\tclass=\"printTime\"\n" + " style=\"width: 80%;\n" +
"\t\t\t\tstyle=\"width: 80%;\n" + " font-family: 宋体;\n" +
"\t\t\t\t\tfont-family: 宋体;\n" + " font-size: 4pt;\n" +
"\t\t\t\t\tfont-size: 4pt;\n" + " display: flex;\n" +
"\t\t\t\t\tdisplay: flex;\n" + " flex-direction: row;\n" +
"\t\t\t\t\tflex-direction: row;\n" + " justify-content: center;\n" +
"\t\t\t\t\tjustify-content: center;\n" + " align-items: flex-end;\"\n" +
"\t\t\t\t\talign-items: flex-end;\"\n" + " >\n" +
"\t\t\t>\n" + " 第一次打印 2020-05-05 12:00 第8/10个\n" +
"\t\t\t\t第一次打印 2020-05-05 12:00 第8/10个\n" + " </div> -->\n" +
"\t\t\t</div>\n" + " <!-- 3 时效类型 -->\n" +
"\t\t\t<!-- 3 时效类型 -->\n" + " <div\n" +
"\t\t\t<div\n" + " style=\"font-family: 黑体;\n" +
"\t\t\t\tclass=\"timeOfDeliveryType\"\n" +
"\t\t\t\tstyle=\"font-family: 黑体;\n" +
"\t\t\t\t\tfont-size: 18pt;\n" + "\t\t\t\t\tfont-size: 18pt;\n" +
"\t\t\t\t\tfont-weight: bolder;\n" + "\t\t\t\t\tfont-weight: bolder;\n" +
"\t\t\t\t\tmargin-right: 2mm;\"\n" + "\t\t\t\t\tmargin-right: 2mm;\"\n" +
"\t\t\t>\n" + " >\n" +
"\t\t\t\t<!-- 3.1 特快即日、特快A、特快、标快、标快陆运、特惠、电商标快 -->\n" + " <!-- 3.1 特快即日、特快A、特快、标快、标快陆运、特惠、电商标快 -->\n" +
"\t\t\t\t特快\n" + " 特快\n" +
"\t\t\t</div>\n" + " </div>\n" +
"\t\t</div>\n" + " </div>\n" +
"\n" + "\n" +
"\n" + "\n" +
"\t\t<!-- 2. 条码区 -->\n" + " <!-- 2. 条码区 -->\n" +
"\t\t<div class=\"barCodeArea\">\n" + " <div>\n" +
"\t\t\t<!-- 2.1 条码 -->\n" + " <!-- 2.1 条码 -->\n" +
"\t\t\t<div class=\"barCode\">\n" + " <div>\n" +
"\t\t\t\t<img src=\"/usr/local/var/www/liquidnet-bus-v1/liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/admin/service/impl/utils/tmphtml/qrcode/out1.png\" style=\"width: 90%; height: 13mm; margin: 0 5mm;\">\n" + " <img src=\"images/yiweima.png\" style=\"width: 90%; height: 13mm; margin: 0 5mm;\">\n" +
"\t\t\t</div>\n" + " </div>\n" +
"\t\t\t<!-- 2.2 子母件单号、汉字、件数标识、 -->\n" + " <!-- 2.2 子母件单号、汉字、件数标识、 -->\n" +
"\t\t\t<div\n" + " <div\n" +
"\t\t\t\tclass=\"childAndParentParts\"\n" + " style=\"font-family: 黑体;\n" +
"\t\t\t\tstyle=\"font-family: 黑体;\n" +
"\t\t\t\t\tfont-size: 10pt;\n" + "\t\t\t\t\tfont-size: 10pt;\n" +
"\t\t\t\t\tdisplay: flex;\n" + "\t\t\t\t\tdisplay: flex;\n" +
"\t\t\t\t\tflex-direction: column;\"\n" + "\t\t\t\t\tflex-direction: column;\"\n" +
"\t\t\t>\n" + " >\n" +
"\t\t\t\t<div>\n" + " <div>\n" +
"\t\t\t\t\t子单号:SF1 010 874 393 776\n" + " 运单号:SF1010874393776\n" +
"\t\t\t\t</div>\n" + " </div>\n" +
"\t\t\t\t<div>\n" + " <!-- <div>\n" +
"\t\t\t\t\t母单号:SF1 010 874 393 776\n" + " 母单号:SF1 010 874 393 776\n" +
"\t\t\t\t</div>\n" + " </div> -->\n" +
"\t\t\t</div>\n" + " </div>\n" +
"\t\t</div>\n" + " </div>\n" +
"\n" + "\n" +
"\t\t<!-- 4\t目的地 -->\n" + " <!-- 4\t目的地 -->\n" +
"\t\t<!-- 4.1 路由信息 暂无-->\n" + " <!-- 4.1 路由信息 暂无-->\n" +
"\t\t<div \n" + " <div\n" +
"\t\t\tclass=\"destinationArea\"\n" + " style=\"margin: 0 auto;\n" +
"\t\t\tstyle=\"margin: 0 auto;\n" +
"\t\t\t\tborder: 1px solid #000;\n" + "\t\t\t\tborder: 1px solid #000;\n" +
"\t\t\t\tborder-bottom: none;\n" + "\t\t\t\tborder-bottom: none;\n" +
"\t\t\t\twidth: 92mm;\"\n" + "\t\t\t\twidth: 92mm;\"\n" +
"\t\t>\n" + " >\n" +
"\t\t\t<!-- 2.3 运单号 -->\n" + " <!-- 2.3 运单号 -->\n" +
"\t\t\t<div\n" + " <div\n" +
"\t\t\t\tclass=\"expressNumber\"\n" + " style=\"font-size: 22pt; font-weight: bold;\"\n" +
"\t\t\t\tstyle=\"font-size: 22pt; font-weight: bold;\"\n" + " >\n" +
"\t\t\t>\n" + " 755W-BA-0123456789\n" +
"\t\t\t\t755W-BA-0123456789\n" + " </div>\n" +
"\t\t\t</div>\n" + " <!-- 5\t收方信息 -->\n" +
"\t\t\t<!-- 5\t收方信息 -->\t\n" + " <div style=\"text-align: left;\">\n" +
"\t\t\t<div class=\"destinationInfo\" style=\"text-align: left;\">\n" + " <!-- 5.1 收 -->\n" +
"\t\t\t\t<!-- 5.1 收 -->\n" + " <div style=\"display: inline-block; width: 9mm; text-align: center;\">\n" +
"\t\t\t\t<div class=\"imgShou\" style=\"display: inline-block; width: 9mm; text-align: center;\">\n" + " <img src=\"images/iconShou.png\" style=\"width:7mm; height:7mm\">\n" +
"\t\t\t\t\t<img src=\"images/iconShou.png\" style=\"width:7mm; height:7mm\">\n" + " </div>\n" +
"\t\t\t\t</div>\n" + " <!-- 5.2 收件人姓名/电话/地址 -->\n" +
"\t\t\t\t<!-- 5.2 收件人姓名/电话/地址 -->\n" + " <div\n" +
"\t\t\t\t<div\n" + " style=\"display: inline-block; width: 62mm; font-family: 宋体; font-size: 9pt; text-align: left;\"\n" +
"\t\t\t\t\tclass=\"recipientInfo\"\n" + " >\n" +
"\t\t\t\t\tstyle=\"display: inline-block; width: 62mm; font-family: 宋体; font-size: 9pt; text-align: left;\"\n" + " <div>\n" +
"\t\t\t\t>\n" + " <span>收货姓名</span>\n" +
"\t\t\t\t\t<div>\n" + " <span>18510980989</span>\n" +
"\t\t\t\t\t\t<span>收货姓名</span>\n" + " </div>\n" +
"\t\t\t\t\t\t<span>18510980989</span>\n" + " <div>\n" +
"\t\t\t\t\t</div>\n" + " <span>收货地址北京市朝阳区摩登天空测试地址</span>\n" +
"\t\t\t\t\t<div>\n" + " </div>\n" +
"\t\t\t\t\t\t<span>收货地址北京市朝阳区摩登天空测试地址</span>\n" + " </div>\n" +
"\t\t\t\t\t</div>\n" + " <!-- 5.3 单元区域编码 暂无-->\n" +
"\t\t\t\t</div>\n" + " <!-- 6\t代收货款 -->\n" +
"\t\t\t\t<!-- 5.3 单元区域编码 暂无-->\n" + " <div style=\"display: inline-block;\">\n" +
"\t\t\t\t<!-- 6\t代收货款 -->\n" + " <!-- 6.1 COD -->\n" +
"\t\t\t\t<div class=\"iconCOD\" style=\"display: inline-block;\">\n" + " <img src=\"images/COD.jpg\" style=\"width: 17mm; height:9mm\">\n" +
"\t\t\t\t\t<!-- 6.1 COD -->\n" + " </div>\n" +
"\t\t\t\t\t<img src=\"images/COD.jpg\" style=\"width: 17mm; height:9mm\">\n" + " </div>\n" +
"\t\t\t\t</div>\n" + " </div>\n" +
"\t\t\t</div>\n" +
"\t\t</div>\n" +
"\n" + "\n" +
"\t\t<table\n" + " <table\n" +
"\t\t\tclass=\"QrCodeArea\"\n" + " border=\"1\"\n" +
"\t\t\tborder=\"1\"\n" + " style=\"margin: 0 auto; border: 1px solid #000; width: 92.5mm; border-collapse:collapse;\"\n" +
"\t\t\tstyle=\"margin: 0 auto; border: 1px solid #000; width: 92.5mm; border-collapse:collapse;\"\n" + " >\n" +
"\t\t>\n" + " <tr>\n" +
"\t\t\t<tr>\n" + " <td style=\"font-family: 宋体; font-size: 9pt;\">\n" +
"\t\t\t\t<td class=\"daofuInfo\" style=\"font-family: 宋体; font-size: 9pt;\">\n" + " 到付22元\n" +
"\t\t\t\t\t到付22元\n" + " </td>\n" +
"\t\t\t\t</td>\n" + " <td rowspan=\"3\">\n" +
"\t\t\t\t<td rowspan=\"3\" class=\"QrCode\">\n" + " <img src=\"images/erweima.png\" style=\"width: 25mm; height: 25mm\">\n" +
"\t\t\t\t\t<img src=\"/usr/local/var/www/liquidnet-bus-v1/liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/admin/service/impl/utils/tmphtml/qrcode/out.png\" style=\"width: 25mm; height: 25mm\">\n" + " </td>\n" +
"\t\t\t\t</td>\n" + " <!-- 13\t已验视 -->\n" +
"\t\t\t\t<!-- 13\t已验视 -->\n" + " <td\n" +
"\t\t\t\t<td\n" + " rowspan=\"3\"\n" +
"\t\t\t\t\trowspan=\"3\"\n" + " style=\"font-family: 黑体; font-size: 22pt; font-weight: bold; color: #272727b3;\"\n" +
"\t\t\t\t\tclass=\"yiyanshiInfo\"\n" + " >\n" +
"\t\t\t\t\tstyle=\"font-family: 黑体; font-size: 22pt; font-weight: bold; color: #272727b3; writing-mode: vertical-lr;\"\n" + " 已\n" +
"\t\t\t\t>\n" + "\t\t\t\t\t<br>\n" +
"\t\t\t\t\t已验视\n" + "\t\t\t\t\t验\n" +
"\t\t\t\t</td>\n" + "\t\t\t\t\t<br>\n" +
"\t\t\t\t<!-- 产品名称\t限时限时KC24字段 -->\n" + "\t\t\t\t\t视\n" +
"\t\t\t\t<td\n" + " </td>\n" +
"\t\t\t\t\trowspan=\"2\"\n" + " <!-- 产品名称\t限时限时KC24字段 -->\n" +
"\t\t\t\t\tclass=\"limitTime\"\n" + " <td\n" +
"\t\t\t\t\tstyle=\"font-family: 宋体; font-size: 12pt; width: 20mm;\"\n" + " rowspan=\"2\"\n" +
"\t\t\t\t>\n" + " style=\"font-family: 宋体; font-size: 12pt; width: 20mm;\"\n" +
"\t\t\t\t\t限时\n" + " >\n" +
"\t\t\t\t\tKC24\n" + " 限时\n" +
"\t\t\t\t</td>\n" + " KC24\n" +
"\t\t\t</tr>\n" + " </td>\n" +
"\t\t\t<tr>\n" + " </tr>\n" +
"\t\t\t\t<td rowspan=\"2\" class=\"jigangInfo\" style=\"font-family: 黑体; font-size: 22pt; font-weight: bold;\">\n" + " <tr>\n" +
"\t\t\t\t\tA22\n" + " <td rowspan=\"2\" style=\"font-family: 黑体; font-size: 22pt; font-weight: bold;\">\n" +
"\t\t\t\t</td>\n" + " A22\n" +
"\t\t\t</tr>\n" + " </td>\n" +
"\t\t\t<tr>\n" + " </tr>\n" +
"\t\t\t\t<td class=\"\">\n" + " <tr>\n" +
"\t\t\t\t\t1A\n" + " <td>\n" +
"\t\t\t\t</td>\n" + " 1A\n" +
"\t\t\t</tr>\n" + " </td>\n" +
"\t\t</table>\n" + " </tr>\n" +
" </table>\n" +
"\n" + "\n" +
"\t\t<!-- 14\t寄方信息 -->\n" + " <!-- 14\t寄方信息 -->\n" +
"\t\t<div\n" + " <div\n" +
"\t\t\tclass=\"jiInfo\"\n" + " style=\"border-left: 1px solid #000;\n" +
"\t\t\tstyle=\"border-left: 1px solid #000;\n" +
"\t\t\t\tborder-right: 1px solid #000;\n" + "\t\t\t\tborder-right: 1px solid #000;\n" +
"\t\t\t\twidth: 92mm;\n" + "\t\t\t\twidth: 92mm;\n" +
"\t\t\t\tmargin: 0 auto;\n" + "\t\t\t\tmargin: 0 auto;\n" +
"\t\t\t\ttext-align: left;\"\n" + "\t\t\t\ttext-align: left;\"\n" +
"\t\t>\n" + " >\n" +
"\t\t\t<div\n" + " <div\n" +
"\t\t\t\tclass=\"imgShou\"\n" + " style=\"display: inline-block; width: 9mm; text-align: center;\"\n" +
"\t\t\t\tstyle=\"display: inline-block; width: 9mm; text-align: center;\"\n" + " >\n" +
"\t\t\t>\n" + " <img src=\"images/iconJi.png\" style=\"width:7mm; height:7mm\">\n" +
"\t\t\t\t<img src=\"images/iconJi.png\" style=\"width:7mm; height:7mm\">\n" + " </div>\n" +
"\t\t\t</div>\n" + " <!-- 14.1 寄件人人姓名/电话/地址 -->\n" +
"\t\t\t<!-- 14.1 寄件人人姓名/电话/地址 -->\n" + " <div\n" +
"\t\t\t<div\n" + " style=\"display: inline-block; width: 62mm; font-family: 宋体; font-size: 9pt; text-align: left;\"\n" +
"\t\t\t\tclass=\"recipientInfo\" \n" + " >\n" +
"\t\t\t\tstyle=\"display: inline-block; width: 62mm; font-family: 宋体; font-size: 9pt; text-align: left;\"\n" + " <div>\n" +
"\t\t\t>\n" + " <span>寄件人姓名</span>\n" +
"\t\t\t\t<div>\n" + " <span>18510980989</span>\n" +
"\t\t\t\t\t<span>寄件人姓名</span>\n" + " </div>\n" +
"\t\t\t\t\t<span>18510980989</span>\n" + " <div>\n" +
"\t\t\t\t</div>\n" + " <span>寄件地址北京市朝阳区摩登天空测试地址</span>\n" +
"\t\t\t\t<div>\n" + " </div>\n" +
"\t\t\t\t\t<span>寄件地址北京市朝阳区摩登天空测试地址</span>\n" + " </div>\n" +
"\t\t\t\t</div>\n" + " </div>\n" +
"\t\t\t</div>\n" + "\n" +
"\t\t</div>\n" + " <table\n" +
"\t\t\n" + " border=\"1\"\n" +
"\t\t<table\n" + " style=\"\n" +
"\t\t\tclass=\"otherInfo\"\n" +
"\t\t\tborder=\"1\"\n" +
"\t\t\tstyle=\"\n" +
"\t\t\t\tmargin: 0 auto;\n" + "\t\t\t\tmargin: 0 auto;\n" +
"\t\t\t\tborder: 1px solid #000;\n" + "\t\t\t\tborder: 1px solid #000;\n" +
"\t\t\t\twidth: 92.5mm;\n" + "\t\t\t\twidth: 92.5mm;\n" +
...@@ -415,57 +423,48 @@ public class CodeUtil { ...@@ -415,57 +423,48 @@ public class CodeUtil {
"\t\t\t\tfont-size: 9pt;\n" + "\t\t\t\tfont-size: 9pt;\n" +
"\t\t\t\ttext-align: left;\n" + "\t\t\t\ttext-align: left;\n" +
"\t\t\t\tborder-collapse:collapse;\"\n" + "\t\t\t\tborder-collapse:collapse;\"\n" +
"\t\t>\n" + " >\n" +
"\t\t\t<tr>\n" + " <tr>\n" +
"\t\t\t\t<!-- 15\t托寄物 -->\n" + " <!-- 15\t托寄物 -->\n" +
"\t\t\t\t<td rowspan=\"2\">\n" + " <td rowspan=\"2\">\n" +
"\t\t\t\t\t托寄物:\n" + " 托寄物:演出票\n" +
"\t\t\t\t</td>\n" + " </td>\n" +
"\t\t\t\t<!-- 16\t增值服务 -->\n" + " <!-- 16\t增值服务 -->\n" +
"\t\t\t\t<td>\n" + " <!-- <td>\n" +
"\t\t\t\t\t增值服务:\n" + " 增值服务:\n" +
"\t\t\t\t</td>\n" + " </td> -->\n" +
"\t\t\t</tr>\n" + " </tr>\n" +
"\t\t\t<!-- 17\t其他信息 -->\n" + " <!-- 17\t其他信息 -->\n" +
"\t\t\t<tr>\n" + " <tr>\n" +
"\t\t\t\t<!-- 17. 1重量 -->\n" + " <!-- 17. 1重量 -->\n" +
"\t\t\t\t<!-- 17.2 付款方式、费用等 -->\n" + " <!-- 17.2 付款方式、费用等 -->\n" +
"\t\t\t\t<td>\n" + " <td>\n" +
"\t\t\t\t\t<div>计费重量:1kg</div>\n" + " <div>计费重量:1kg</div>\n" +
"\t\t\t\t\t<div>实际重量: 1kg</div>\n" + " <div>实际重量:1kg</div>\n" +
"\t\t\t\t\t<div>费用合计:22元</div>\n" + " <div>费用合计:22元</div>\n" +
"\t\t\t\t\t<div>付款方式:寄付现结</div>\n" + " <div>付款方式:到付</div>\n" +
"\t\t\t\t</td>\n" + " </td>\n" +
"\t\t\t</tr>\n" + " </tr>\n" +
"\t\t\t<tr>\n" + " <tr>\n" +
"\t\t\t\t<!-- 18\t客户自定义区 -->\n" + " <!-- 18\t客户自定义区 -->\n" +
"\t\t\t\t<td>\n" + " <td>\n" +
"\t\t\t\t\t客户自定义区\n" + " 票种:\n" +
"\t\t\t\t\t备注\n" + " <br>\n" +
"\t\t\t\t\t转寄协议客户\n" + " 数量:\n" +
"\t\t\t\t\t订单等信息\n" + " </td>\n" +
"\t\t\t\t</td>\n" + " <!-- 19\t图标区域 -->\n" +
"\t\t\t\t<!-- 19\t图标区域 -->\n" + " <td>\n" +
"\t\t\t\t<td>\n" + " <!-- 图标区域 -->\n" +
"\t\t\t\t\t图标区域\n" + " <!-- 贴纸信息 -->\n" +
"\t\t\t\t\t贴纸信息\n" + " </td>\n" +
"\t\t\t\t</td>\n" + " </tr>\n" +
"\t\t\t</tr>\n" + " </table>\n" +
"\t\t</table>\n" +
"\t\t\n" +
"\t</div>\n" +
"</body>\n" +
"\n" + "\n" +
"</div>\n" +
"</body>\n" +
"\n" + "\n" +
"</html>"; "</html>";
Html2Image html2Image = Html2Image.fromHtml(html); return html;
html2Image.getImageRenderer().saveImage("/Users/jiangxiulong/Desktop/aaa.png");
}
public static void main(String[] args) {
html2img();
// 打印图片
drawImage("/Users/jiangxiulong/Desktop/aaa.png", 1);
} }
} }
<!DOCTYPE html>
<html lang="en" style="width: 100mm;">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Access-Control-Allow-Origin" content="*" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="address=no" />
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<!-- 顺丰快递面单打印,尺寸:100mm*150mm模版 -->
<div
style="width: 96mm;
height: 150mm;
padding-top: 5mm;
border: 1px solid #000;
text-align: center;"
>
<!-- 1. 运单打印系统来源及时间等 -->
<div
style="width: 100%;
font-family: 宋体;
font-size: 4pt;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-end;"
>
<!-- 1.1 打印系统来源(太长放不下了,所以去掉了) -->
<!-- <div class="source">
SCP顺丰云打印
</div> -->
<!-- 1.2 打印次数/时间 -->
<!-- <div
style="width: 80%;
font-family: 宋体;
font-size: 4pt;
display: flex;
flex-direction: row;
justify-content: center;
align-items: flex-end;"
>
第一次打印 2020-05-05 12:00 第8/10个
</div> -->
<!-- 3 时效类型 -->
<div
style="font-family: 黑体;
font-size: 18pt;
font-weight: bolder;
margin-right: 2mm;"
>
<!-- 3.1 特快即日、特快A、特快、标快、标快陆运、特惠、电商标快 -->
特快
</div>
</div>
<!-- 2. 条码区 -->
<div>
<!-- 2.1 条码 -->
<div>
<img src="images/yiweima.png" style="width: 90%; height: 13mm; margin: 0 5mm;">
</div>
<!-- 2.2 子母件单号、汉字、件数标识、 -->
<div
style="font-family: 黑体;
font-size: 10pt;
display: flex;
flex-direction: column;"
>
<div>
运单号:SF1010874393776
</div>
<!-- <div>
母单号:SF1 010 874 393 776
</div> -->
</div>
</div>
<!-- 4 目的地 -->
<!-- 4.1 路由信息 暂无-->
<div
style="margin: 0 auto;
border: 1px solid #000;
border-bottom: none;
width: 92mm;"
>
<!-- 2.3 运单号 -->
<div
style="font-size: 22pt; font-weight: bold;"
>
755W-BA-0123456789
</div>
<!-- 5 收方信息 -->
<div style="text-align: left;">
<!-- 5.1 收 -->
<div style="display: inline-block; width: 9mm; text-align: center;">
<img src="images/iconShou.png" style="width:7mm; height:7mm">
</div>
<!-- 5.2 收件人姓名/电话/地址 -->
<div
style="display: inline-block; width: 62mm; font-family: 宋体; font-size: 9pt; text-align: left;"
>
<div>
<span>收货姓名</span>
<span>18510980989</span>
</div>
<div>
<span>收货地址北京市朝阳区摩登天空测试地址</span>
</div>
</div>
<!-- 5.3 单元区域编码 暂无-->
<!-- 6 代收货款 -->
<div style="display: inline-block;">
<!-- 6.1 COD -->
<img src="images/COD.jpg" style="width: 17mm; height:9mm">
</div>
</div>
</div>
<table
border="1"
style="margin: 0 auto; border: 1px solid #000; width: 92.5mm; border-collapse:collapse;"
>
<tr>
<td style="font-family: 宋体; font-size: 9pt;">
到付22元
</td>
<td rowspan="3">
<img src="images/erweima.png" style="width: 25mm; height: 25mm">
</td>
<!-- 13 已验视 -->
<td
rowspan="3"
style="font-family: 黑体; font-size: 22pt; font-weight: bold; color: #272727b3;"
>
<br>
<br>
</td>
<!-- 产品名称 限时限时KC24字段 -->
<td
rowspan="2"
style="font-family: 宋体; font-size: 12pt; width: 20mm;"
>
限时
KC24
</td>
</tr>
<tr>
<td rowspan="2" style="font-family: 黑体; font-size: 22pt; font-weight: bold;">
A22
</td>
</tr>
<tr>
<td>
1A
</td>
</tr>
</table>
<!-- 14 寄方信息 -->
<div
style="border-left: 1px solid #000;
border-right: 1px solid #000;
width: 92mm;
margin: 0 auto;
text-align: left;"
>
<div
style="display: inline-block; width: 9mm; text-align: center;"
>
<img src="images/iconJi.png" style="width:7mm; height:7mm">
</div>
<!-- 14.1 寄件人人姓名/电话/地址 -->
<div
style="display: inline-block; width: 62mm; font-family: 宋体; font-size: 9pt; text-align: left;"
>
<div>
<span>寄件人姓名</span>
<span>18510980989</span>
</div>
<div>
<span>寄件地址北京市朝阳区摩登天空测试地址</span>
</div>
</div>
</div>
<table
border="1"
style="
margin: 0 auto;
border: 1px solid #000;
width: 92.5mm;
font-family: 宋体;
font-size: 9pt;
text-align: left;
border-collapse:collapse;"
>
<tr>
<!-- 15 托寄物 -->
<td rowspan="2">
托寄物:演出票
</td>
<!-- 16 增值服务 -->
<!-- <td>
增值服务:
</td> -->
</tr>
<!-- 17 其他信息 -->
<tr>
<!-- 17. 1重量 -->
<!-- 17.2 付款方式、费用等 -->
<td>
<div>计费重量:1kg</div>
<div>实际重量:1kg</div>
<div>费用合计:22元</div>
<div>付款方式:到付</div>
</td>
</tr>
<tr>
<!-- 18 客户自定义区 -->
<td>
票种:
<br>
数量:
</td>
<!-- 19 图标区域 -->
<td>
<!-- 图标区域 -->
<!-- 贴纸信息 -->
</td>
</tr>
</table>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Access-Control-Allow-Origin" content="*" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=yes" /><!-- 点击链接打电话 -->
<meta name="format-detection" content="address=no" />
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="icon" type="image/png" sizes="12x12" href="https://img.zhengzai.tv/static/img/logo_small.png">
</head>
<body>
<!-- 顺丰快递面单打印,尺寸:100mm*150mm模版 -->
<div
id="shunfeng-express"
style="width: 96mm;
height: 150mm;
padding-top: 5mm;
border: 1px solid #000;
text-align: center;"
>
<!-- 1. 运单打印系统来源及时间等 -->
<div
class="sourceAndPrintTime"
style="width: 100%;
font-family: 宋体;
font-size: 4pt;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-end;"
>
<!-- 1.1 打印系统来源(太长放不下了,所以去掉了) -->
<!-- <div class="source">
SCP顺丰云打印
</div> -->
<!-- 1.2 打印次数/时间 -->
<div
class="printTime"
style="width: 80%;
font-family: 宋体;
font-size: 4pt;
display: flex;
flex-direction: row;
justify-content: center;
align-items: flex-end;"
>
第一次打印 2020-05-05 12:00 第8/10个
</div>
<!-- 3 时效类型 -->
<div
class="timeOfDeliveryType"
style="font-family: 黑体;
font-size: 18pt;
font-weight: bolder;
margin-right: 2mm;"
>
<!-- 3.1 特快即日、特快A、特快、标快、标快陆运、特惠、电商标快 -->
特快
</div>
</div>
<!-- 2. 条码区 -->
<div class="barCodeArea">
<!-- 2.1 条码 -->
<div class="barCode">
<img src="/usr/local/var/www/liquidnet-bus-v1/liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/admin/service/impl/utils/tmphtml/qrcode/out1.png" style="width: 90%; height: 13mm; margin: 0 5mm;">
</div>
<!-- 2.2 子母件单号、汉字、件数标识、 -->
<div
class="childAndParentParts"
style="font-family: 黑体;
font-size: 10pt;
display: flex;
flex-direction: column;"
>
<div>
子单号:SF1 010 874 393 776
</div>
<div>
母单号:SF1 010 874 393 776
</div>
</div>
</div>
<!-- 4 目的地 -->
<!-- 4.1 路由信息 暂无-->
<div
class="destinationArea"
style="margin: 0 auto;
border: 1px solid #000;
border-bottom: none;
width: 92mm;"
>
<!-- 2.3 运单号 -->
<div
class="expressNumber"
style="font-size: 22pt; font-weight: bold;"
>
755W-BA-0123456789
</div>
<!-- 5 收方信息 -->
<div class="destinationInfo" style="text-align: left;">
<!-- 5.1 收 -->
<div class="imgShou" style="display: inline-block; width: 9mm; text-align: center;">
<img src="images/iconShou.png" style="width:7mm; height:7mm">
</div>
<!-- 5.2 收件人姓名/电话/地址 -->
<div
class="recipientInfo"
style="display: inline-block; width: 62mm; font-family: 宋体; font-size: 9pt; text-align: left;"
>
<div>
<span>收货姓名</span>
<span>18510980989</span>
</div>
<div>
<span>收货地址北京市朝阳区摩登天空测试地址</span>
</div>
</div>
<!-- 5.3 单元区域编码 暂无-->
<!-- 6 代收货款 -->
<div class="iconCOD" style="display: inline-block;">
<!-- 6.1 COD -->
<img src="images/COD.jpg" style="width: 17mm; height:9mm">
</div>
</div>
</div>
<table
class="QrCodeArea"
border="1"
style="margin: 0 auto; border: 1px solid #000; width: 92.5mm; border-collapse:collapse;"
>
<tr>
<td class="daofuInfo" style="font-family: 宋体; font-size: 9pt;">
到付22元
</td>
<td rowspan="3" class="QrCode">
<img src="/usr/local/var/www/liquidnet-bus-v1/liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/admin/service/impl/utils/tmphtml/qrcode/out.png" style="width: 25mm; height: 25mm">
</td>
<!-- 13 已验视 -->
<td
rowspan="3"
class="yiyanshiInfo"
style="font-family: 黑体; font-size: 22pt; font-weight: bold; color: #272727b3; writing-mode: vertical-lr;"
>
已验视
</td>
<!-- 产品名称 限时限时KC24字段 -->
<td
rowspan="2"
class="limitTime"
style="font-family: 宋体; font-size: 12pt; width: 20mm;"
>
限时
KC24
</td>
</tr>
<tr>
<td rowspan="2" class="jigangInfo" style="font-family: 黑体; font-size: 22pt; font-weight: bold;">
A22
</td>
</tr>
<tr>
<td class="">
1A
</td>
</tr>
</table>
<!-- 14 寄方信息 -->
<div
class="jiInfo"
style="border-left: 1px solid #000;
border-right: 1px solid #000;
width: 92mm;
margin: 0 auto;
text-align: left;"
>
<div
class="imgShou"
style="display: inline-block; width: 9mm; text-align: center;"
>
<img src="images/iconJi.png" style="width:7mm; height:7mm">
</div>
<!-- 14.1 寄件人人姓名/电话/地址 -->
<div
class="recipientInfo"
style="display: inline-block; width: 62mm; font-family: 宋体; font-size: 9pt; text-align: left;"
>
<div>
<span>寄件人姓名</span>
<span>18510980989</span>
</div>
<div>
<span>寄件地址北京市朝阳区摩登天空测试地址</span>
</div>
</div>
</div>
<table
class="otherInfo"
border="1"
style="
margin: 0 auto;
border: 1px solid #000;
width: 92.5mm;
font-family: 宋体;
font-size: 9pt;
text-align: left;
border-collapse:collapse;"
>
<tr>
<!-- 15 托寄物 -->
<td rowspan="2">
托寄物:
</td>
<!-- 16 增值服务 -->
<td>
增值服务:
</td>
</tr>
<!-- 17 其他信息 -->
<tr>
<!-- 17. 1重量 -->
<!-- 17.2 付款方式、费用等 -->
<td>
<div>计费重量:1kg</div>
<div>实际重量: 1kg</div>
<div>费用合计:22元</div>
<div>付款方式:寄付现结</div>
</td>
</tr>
<tr>
<!-- 18 客户自定义区 -->
<td>
客户自定义区
备注
转寄协议客户
订单等信息
</td>
<!-- 19 图标区域 -->
<td>
图标区域
贴纸信息
</td>
</tr>
</table>
</div>
</body>
</html>
\ No newline at end of file
...@@ -564,253 +564,7 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres ...@@ -564,253 +564,7 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
} }
public void print() { public void print() {
String html = "<!DOCTYPE html>\n" +
"<html lang=\"en\">\n" +
"<body>\n" +
"\t<!-- 顺丰快递面单打印,尺寸:100mm*150mm模版 -->\n" +
"\t<div\n" +
"\t\tid=\"shunfeng-express\"\n" +
"\t\tstyle=\"width: 96mm;\n" +
"\t\t\theight: 150mm;\n" +
"\t\t\tpadding-top: 5mm;\n" +
"\t\t\tborder: 1px solid #000;\n" +
"\t\t\ttext-align: center;\"\n" +
"\t>\n" +
"\t\t<!-- 1. 运单打印系统来源及时间等 -->\n" +
"\t\t<div \n" +
"\t\t\tclass=\"sourceAndPrintTime\"\n" +
"\t\t\tstyle=\"width: 100%;\n" +
"\t\t\t\tfont-family: 宋体;\n" +
"\t\t\t\tfont-size: 4pt;\n" +
"\t\t\t\tdisplay: flex;\n" +
"\t\t\t\tflex-direction: row;\n" +
"\t\t\t\tjustify-content: space-between;\n" +
"\t\t\t\talign-items: flex-end;\"\n" +
"\t\t>\n" +
"\t\t\t<!-- 1.1 打印系统来源(太长放不下了,所以去掉了) -->\n" +
"\t\t\t<!-- <div class=\"source\">\n" +
"\t\t\t\tSCP顺丰云打印\n" +
"\t\t\t</div> -->\n" +
"\t\t\t<!-- 1.2 打印次数/时间 -->\n" +
"\t\t\t<div\n" +
"\t\t\t\tclass=\"printTime\"\n" +
"\t\t\t\tstyle=\"width: 50%;\n" +
"\t\t\t\t\tfont-family: 宋体;\n" +
"\t\t\t\t\tfont-size: 4pt;\n" +
"\t\t\t\t\tdisplay: flex;\n" +
"\t\t\t\t\tflex-direction: row;\n" +
"\t\t\t\t\tjustify-content: center;\n" +
"\t\t\t\t\talign-items: flex-end;\"\n" +
"\t\t\t>\n" +
"\t\t\t\t第一次打印 2020-05-05 12:00 第8/10个\n" +
"\t\t\t</div>\n" +
"\t\t\t<!-- 3 时效类型 -->\n" +
"\t\t\t<div\n" +
"\t\t\t\tclass=\"timeOfDeliveryType\"\n" +
"\t\t\t\tstyle=\"font-family: 黑体;\n" +
"\t\t\t\t\tfont-size: 18pt;\n" +
"\t\t\t\t\tfont-weight: bolder;\n" +
"\t\t\t\t\tmargin-right: 2mm;\"\n" +
"\t\t\t>\n" +
"\t\t\t\t<!-- 3.1 特快即日、特快A、特快、标快、标快陆运、特惠、电商标快 -->\n" +
"\t\t\t\t特快\n" +
"\t\t\t</div>\n" +
"\t\t</div>\n" +
"\n" +
"\n" +
"\t\t<!-- 2. 条码区 -->\n" +
"\t\t<div class=\"barCodeArea\">\n" +
"\t\t\t<!-- 2.1 条码 -->\n" +
"\t\t\t<div class=\"barCode\">\n" +
"\t\t\t\t<img src=\"https://img.zhengzai.tv/static/img/logo_small.png\" style=\"width: 90%; height: 13mm; margin: 0 5mm;\">\n" +
"\t\t\t</div>\n" +
"\t\t\t<!-- 2.2 子母件单号、汉字、件数标识、 -->\n" +
"\t\t\t<div\n" +
"\t\t\t\tclass=\"childAndParentParts\"\n" +
"\t\t\t\tstyle=\"font-family: 黑体;\n" +
"\t\t\t\t\tfont-size: 10pt;\n" +
"\t\t\t\t\tdisplay: flex;\n" +
"\t\t\t\t\tflex-direction: column;\"\n" +
"\t\t\t>\n" +
"\t\t\t\t<div>\n" +
"\t\t\t\t\t子单号:SF1 010 874 393 776\n" +
"\t\t\t\t</div>\n" +
"\t\t\t\t<div>\n" +
"\t\t\t\t\t母单号:SF1 010 874 393 776\n" +
"\t\t\t\t</div>\n" +
"\t\t\t</div>\n" +
"\t\t</div>\n" +
"\n" +
"\t\t<!-- 4\t目的地 -->\n" +
"\t\t<!-- 4.1 路由信息 暂无-->\n" +
"\t\t<div \n" +
"\t\t\tclass=\"destinationArea\"\n" +
"\t\t\tstyle=\"margin: 0 auto;\n" +
"\t\t\t\tborder: 1px solid #000;\n" +
"\t\t\t\tborder-bottom: none;\n" +
"\t\t\t\twidth: 92mm;\"\n" +
"\t\t>\n" +
"\t\t\t<!-- 2.3 运单号 -->\n" +
"\t\t\t<div\n" +
"\t\t\t\tclass=\"expressNumber\"\n" +
"\t\t\t\tstyle=\"font-size: 22pt; font-weight: bold;\"\n" +
"\t\t\t>\n" +
"\t\t\t\t755W-BA-0123456789\n" +
"\t\t\t</div>\n" +
"\t\t\t<!-- 5\t收方信息 -->\t\n" +
"\t\t\t<div class=\"destinationInfo\" style=\"text-align: left;\">\n" +
"\t\t\t\t<!-- 5.1 收 -->\n" +
"\t\t\t\t<div class=\"imgShou\" style=\"display: inline-block; width: 9mm; text-align: center;\">\n" +
"\t\t\t\t\t<img src=\"./images/iconShou.png\" style=\"width:7mm; height:7mm\">\n" +
"\t\t\t\t</div>\n" +
"\t\t\t\t<!-- 5.2 收件人姓名/电话/地址 -->\n" +
"\t\t\t\t<div\n" +
"\t\t\t\t\tclass=\"recipientInfo\"\n" +
"\t\t\t\t\tstyle=\"display: inline-block; width: 62mm; font-family: 宋体; font-size: 9pt; text-align: left;\"\n" +
"\t\t\t\t>\n" +
"\t\t\t\t\t<div>\n" +
"\t\t\t\t\t\t<span>收货姓名</span>\n" +
"\t\t\t\t\t\t<span>18510980989</span>\n" +
"\t\t\t\t\t</div>\n" +
"\t\t\t\t\t<div>\n" +
"\t\t\t\t\t\t<span>收货地址北京市朝阳区摩登天空测试地址</span>\n" +
"\t\t\t\t\t</div>\n" +
"\t\t\t\t</div>\n" +
"\t\t\t\t<!-- 5.3 单元区域编码 暂无-->\n" +
"\t\t\t\t<!-- 6\t代收货款 -->\n" +
"\t\t\t\t<div class=\"iconCOD\" style=\"display: inline-block;\">\n" +
"\t\t\t\t\t<!-- 6.1 COD -->\n" +
"\t\t\t\t\t<img src=\"./images/COD.jpg\" style=\"width: 17mm; height:9mm\">\n" +
"\t\t\t\t</div>\n" +
"\t\t\t</div>\n" +
"\t\t</div>\n" +
"\n" +
"\t\t<table\n" +
"\t\t\tclass=\"QrCodeArea\"\n" +
"\t\t\tborder=\"1\"\n" +
"\t\t\tstyle=\"margin: 0 auto; border: 1px solid #000; width: 92.5mm; border-collapse:collapse;\"\n" +
"\t\t>\n" +
"\t\t\t<tr>\n" +
"\t\t\t\t<td class=\"daofuInfo\" style=\"font-family: 宋体; font-size: 9pt;\">\n" +
"\t\t\t\t\t到付22元\n" +
"\t\t\t\t</td>\n" +
"\t\t\t\t<td rowspan=\"3\" class=\"QrCode\">\n" +
"\t\t\t\t\t<img src=\"./images/erweima.png\" style=\"width: 25mm; height: 25mm\">\n" +
"\t\t\t\t</td>\n" +
"\t\t\t\t<!-- 13\t已验视 -->\n" +
"\t\t\t\t<td\n" +
"\t\t\t\t\trowspan=\"3\"\n" +
"\t\t\t\t\tclass=\"yiyanshiInfo\"\n" +
"\t\t\t\t\tstyle=\"font-family: 黑体; font-size: 22pt; font-weight: bold; color: #272727b3; writing-mode: vertical-lr;\"\n" +
"\t\t\t\t>\n" +
"\t\t\t\t\t已验视\n" +
"\t\t\t\t</td>\n" +
"\t\t\t\t<!-- 产品名称\t限时限时KC24字段 -->\n" +
"\t\t\t\t<td\n" +
"\t\t\t\t\trowspan=\"2\"\n" +
"\t\t\t\t\tclass=\"limitTime\"\n" +
"\t\t\t\t\tstyle=\"font-family: 宋体; font-size: 12pt; width: 20mm;\"\n" +
"\t\t\t\t>\n" +
"\t\t\t\t\t限时\n" +
"\t\t\t\t\tKC24\n" +
"\t\t\t\t</td>\n" +
"\t\t\t</tr>\n" +
"\t\t\t<tr>\n" +
"\t\t\t\t<td rowspan=\"2\" class=\"jigangInfo\" style=\"font-family: 黑体; font-size: 22pt; font-weight: bold;\">\n" +
"\t\t\t\t\tA22\n" +
"\t\t\t\t</td>\n" +
"\t\t\t</tr>\n" +
"\t\t\t<tr>\n" +
"\t\t\t\t<td class=\"\">\n" +
"\t\t\t\t\t1A\n" +
"\t\t\t\t</td>\n" +
"\t\t\t</tr>\n" +
"\t\t</table>\n" +
"\n" +
"\t\t<!-- 14\t寄方信息 -->\n" +
"\t\t<div\n" +
"\t\t\tclass=\"jiInfo\"\n" +
"\t\t\tstyle=\"border-left: 1px solid #000;\n" +
"\t\t\t\tborder-right: 1px solid #000;\n" +
"\t\t\t\twidth: 92mm;\n" +
"\t\t\t\tmargin: 0 auto;\n" +
"\t\t\t\ttext-align: left;\"\n" +
"\t\t>\n" +
"\t\t\t<div\n" +
"\t\t\t\tclass=\"imgShou\"\n" +
"\t\t\t\tstyle=\"display: inline-block; width: 9mm; text-align: center;\"\n" +
"\t\t\t>\n" +
"\t\t\t\t<img src=\"./images/iconJi.png\" style=\"width:7mm; height:7mm\">\n" +
"\t\t\t</div>\n" +
"\t\t\t<!-- 14.1 寄件人人姓名/电话/地址 -->\n" +
"\t\t\t<div\n" +
"\t\t\t\tclass=\"recipientInfo\" \n" +
"\t\t\t\tstyle=\"display: inline-block; width: 62mm; font-family: 宋体; font-size: 9pt; text-align: left;\"\n" +
"\t\t\t>\n" +
"\t\t\t\t<div>\n" +
"\t\t\t\t\t<span>寄件人姓名</span>\n" +
"\t\t\t\t\t<span>18510980989</span>\n" +
"\t\t\t\t</div>\n" +
"\t\t\t\t<div>\n" +
"\t\t\t\t\t<span>寄件地址北京市朝阳区摩登天空测试地址</span>\n" +
"\t\t\t\t</div>\n" +
"\t\t\t</div>\n" +
"\t\t</div>\n" +
"\t\t\n" +
"\t\t<table\n" +
"\t\t\tclass=\"otherInfo\"\n" +
"\t\t\tborder=\"1\"\n" +
"\t\t\tstyle=\"\n" +
"\t\t\t\tmargin: 0 auto;\n" +
"\t\t\t\tborder: 1px solid #000;\n" +
"\t\t\t\twidth: 92.5mm;\n" +
"\t\t\t\tfont-family: 宋体;\n" +
"\t\t\t\tfont-size: 9pt;\n" +
"\t\t\t\ttext-align: left;\n" +
"\t\t\t\tborder-collapse:collapse;\"\n" +
"\t\t>\n" +
"\t\t\t<tr>\n" +
"\t\t\t\t<!-- 15\t托寄物 -->\n" +
"\t\t\t\t<td rowspan=\"2\">\n" +
"\t\t\t\t\t托寄物:\n" +
"\t\t\t\t</td>\n" +
"\t\t\t\t<!-- 16\t增值服务 -->\n" +
"\t\t\t\t<td>\n" +
"\t\t\t\t\t增值服务:\n" +
"\t\t\t\t</td>\n" +
"\t\t\t</tr>\n" +
"\t\t\t<!-- 17\t其他信息 -->\n" +
"\t\t\t<tr>\n" +
"\t\t\t\t<!-- 17. 1重量 -->\n" +
"\t\t\t\t<!-- 17.2 付款方式、费用等 -->\n" +
"\t\t\t\t<td>\n" +
"\t\t\t\t\t<div>计费重量:1kg</div>\n" +
"\t\t\t\t\t<div>实际重量: 1kg</div>\n" +
"\t\t\t\t\t<div>费用合计:22元</div>\n" +
"\t\t\t\t\t<div>付款方式:寄付现结</div>\n" +
"\t\t\t\t</td>\n" +
"\t\t\t</tr>\n" +
"\t\t\t<tr>\n" +
"\t\t\t\t<!-- 18\t客户自定义区 -->\n" +
"\t\t\t\t<td>\n" +
"\t\t\t\t\t客户自定义区\n" +
"\t\t\t\t\t备注\n" +
"\t\t\t\t\t转寄协议客户\n" +
"\t\t\t\t\t订单等信息\n" +
"\t\t\t\t</td>\n" +
"\t\t\t\t<!-- 19\t图标区域 -->\n" +
"\t\t\t\t<td>\n" +
"\t\t\t\t\t图标区域\n" +
"\t\t\t\t\t贴纸信息\n" +
"\t\t\t\t</td>\n" +
"\t\t\t</tr>\n" +
"\t\t</table>\n" +
"\t\t\n" +
"\t</div>\n" +
"</body>\n" +
"\n" +
"\n" +
"</html>";
// codeUtil.html2img(html); // codeUtil.html2img(html);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment