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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
package com.yanzuoguang.util.printer.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.yanzuoguang.util.vo.BaseVo;
import java.util.ArrayList;
import java.util.List;
/**
* 本实体用于C#,所以需要属性首字母大写,不能将其转换为字段
*
* @author 颜佐光
*/
public class PrinterPagerData extends BaseVo {
/**
* 纸张宽度
*/
@JSONField(name = "PageWidth")
private double pageWidth;
/**
* 纸张高度
*/
@JSONField(name = "PageHeight")
private double pageHeight;
/**
* 左边边距
*/
@JSONField(name = "MarginLeft")
private double marginLeft;
/**
* 上边边距
*/
@JSONField(name = "MarginTop")
private double marginTop;
/**
* 右边边距
*/
@JSONField(name = "MarginRight")
private double marginRight;
/**
* 下边边距
*/
@JSONField(name = "MarginBottom")
private double marginBottom;
/**
* 打印角度
*/
@JSONField(name = "PrintAngle")
private float printAngle;
/**
* 所有页面需要打印得属性
*/
@JSONField(name = "Items")
private List<PrinterPagerItemData> items;
/**
* 构造函数
*/
public PrinterPagerData() {
this.pageWidth = 180;
this.pageHeight = 100;
this.marginLeft = 0;
this.marginTop = 0;
this.marginRight = 0;
this.marginBottom = 0;
this.printAngle = 0;
this.items = new ArrayList<>();
}
/**
* 清除位置
*/
public void clearPosition() {
this.items.clear();
}
/**
* 复制当前配置到新对象
*
* @param to 复制到得对象
*/
public void copyTo(PrinterPagerData to) {
to.pageWidth = this.pageWidth;
to.pageHeight = this.pageHeight;
to.marginLeft = this.marginLeft;
to.marginTop = this.marginTop;
to.marginRight = this.marginRight;
to.marginBottom = this.marginBottom;
to.printAngle = this.printAngle;
to.items.clear();
for (PrinterPagerItemData item : this.items) {
PrinterPagerItemData item_to = new PrinterPagerItemData();
item.copyTo(item_to);
to.items.add(item_to);
}
}
public double getPageWidth() {
return pageWidth;
}
public void setPageWidth(double pageWidth) {
this.pageWidth = pageWidth;
}
public double getPageHeight() {
return pageHeight;
}
public void setPageHeight(double pageHeight) {
this.pageHeight = pageHeight;
}
public double getMarginLeft() {
return marginLeft;
}
public void setMarginLeft(double marginLeft) {
this.marginLeft = marginLeft;
}
public double getMarginTop() {
return marginTop;
}
public void setMarginTop(double marginTop) {
this.marginTop = marginTop;
}
public double getMarginRight() {
return marginRight;
}
public void setMarginRight(double marginRight) {
this.marginRight = marginRight;
}
public double getMarginBottom() {
return marginBottom;
}
public void setMarginBottom(double marginBottom) {
this.marginBottom = marginBottom;
}
public float getPrintAngle() {
return printAngle;
}
public void setPrintAngle(float printAngle) {
this.printAngle = printAngle;
}
public List<PrinterPagerItemData> getItems() {
return items;
}
public void setItems(List<PrinterPagerItemData> items) {
this.items = items;
}
}