9927b97e
“wangming”
Improve GP_R3 pri...
|
1
2
3
4
5
6
7
8
9
10
|
import type {
LabelPrintPayload,
LabelTemplateData,
MonochromeImageData,
PrintImageOptions,
StructuredLabelTemplate,
} from '../types/printer'
import { resolveTscTemplate } from '../templateRenderer'
import { createTestPrintTemplate } from '../templates/testPrintTemplate'
import { buildTestTscLabel, buildTscImageLabel, buildTscLabel, buildTscTemplateLabel } from '../tscLabelBuilder'
|
961eecae
“wangming”
对打印机进行开发
|
11
12
|
export function buildTscTestPrintData (): number[] {
|
9927b97e
“wangming”
Improve GP_R3 pri...
|
13
14
15
16
17
|
const template = createTestPrintTemplate(203, 1)
if (!template.tsc) {
throw new Error('Test template does not support TSC printers')
}
return buildTscTemplateLabel(template.tsc)
|
961eecae
“wangming”
对打印机进行开发
|
18
19
20
21
22
|
}
export function buildTscLabelData (payload: LabelPrintPayload): number[] {
return buildTscLabel(payload)
}
|
9927b97e
“wangming”
Improve GP_R3 pri...
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
export function buildTscImageData (
image: MonochromeImageData,
options: PrintImageOptions = {},
dpi = 203
): number[] {
return buildTscImageLabel(image, options, dpi)
}
export function buildTscTemplateData (
template: StructuredLabelTemplate,
data: LabelTemplateData = {}
): number[] {
return buildTscTemplateLabel(resolveTscTemplate(template, data))
}
|