lilei 3 年之前
父節點
當前提交
2916afcdcf
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      libs/printTools.js

+ 10 - 1
libs/printTools.js

@@ -60,7 +60,16 @@ export const textFormat = function(command,text,maxFontNums,left,top,lightHeight
 	}
 	return rowTop
 }
-
+export const printText = function(tsc,text){
+	const command = tsc.jpPrinter.createNew()
+	command.init()
+	command.setSize(40, 30) // 标签纸张宽高,单位mm
+	command.setGap(3) // 标签上下间距,单位mm
+	command.setCls() // 清除缓冲区数据
+	command.setText(100, 48, "5", 4, 3, text)
+	command.setPagePrint(1,1) // 打印分数1,每个标签重发打印2次
+	return command
+}
 // 60 * 40 尺寸模板
 export const printTempl = function(tsc,data){
 	let top = 24 // 距离顶部10点像素