-
Notifications
You must be signed in to change notification settings - Fork 1
/
LabelHome.swift
48 lines (45 loc) · 1.39 KB
/
LabelHome.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// LabelHome.swift
//
//
// Created by chen on 2023/11/11.
//
import Foundation
/// The ^LH command sets the label home position.
///
/// # Label Home
///
/// The default home position of a label is the upper-left corner (position 0,0 along the x and y axis).
/// This is the axis reference point for labels. Any area below and to the right of this point is available for printing.
/// The ^LH command changes this reference point.
/// For instance, when working with preprinted labels, use this command to move the reference point below the preprinted area.
///
/// This command affects only fields that come after it.
///
/// - Remark: It is recommended to use ^LH as one of the first commands in the label format.
public struct LabelHome: ZPLCommandConvertible {
/// x-axis position (in dots)
///
/// Values: 0 to 32000
///
/// Initial Value at Power Up: 0 or last permanently saved value
public var x: Int
/// y-axis position (in dots)
///
/// Values: 0 to 32000
///
/// Initial Value at Power Up: 0 or last permanently saved value
public var y: Int
public var command: String {
"^LH\(x),\(y)"
}
/// Label Home.
///
/// - Parameters:
/// - x: x-axis position (in dots). 0 to 32000.
/// - y: y-axis position (in dots). 0 to 32000.
public init(x: Int, y: Int) {
self.x = x
self.y = y
}
}