aspose.barcode 20.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/End+User+License+Agreement.html +10 -0
- package/README.md +161 -0
- package/ThirdPartyLicenses.Aspose.BarCode.Java.pdf +0 -0
- package/examples/BarcodeGeneratorExamples.js +231 -0
- package/examples/BarcodeReaderExamples.js +260 -0
- package/examples/ExamplesAssist.js +75 -0
- package/examples/GenerateAndReadExample.js +25 -0
- package/examples/how_to.txt +13 -0
- package/examples/how_to_generate_and_read_example.js.cmd +2 -0
- package/examples/how_to_generate_barcode_examples.js.cmd +2 -0
- package/examples/how_to_read_barcode_examples.js.cmd +2 -0
- package/examples/lic/.stub +1 -0
- package/examples/resources/generating/.stub +1 -0
- package/examples/resources/recognition/code11.png +0 -0
- package/examples/resources/recognition/code128.jpg +0 -0
- package/examples/resources/recognition/example1.png +0 -0
- package/examples/resources/recognition/example2.jpg +0 -0
- package/index.js +3 -0
- package/lib/AsposeBarcode.js +100 -0
- package/lib/ComplexBarcode.js +1461 -0
- package/lib/Generation.js +5077 -0
- package/lib/Joint.js +439 -0
- package/lib/Recognition.js +3616 -0
- package/lib/aspose-barcode-nodejs-20.6.jar +0 -0
- package/package.json +21 -0
|
@@ -0,0 +1,1461 @@
|
|
|
1
|
+
const generation = require("./Generation");
|
|
2
|
+
const joint = require('./Joint');
|
|
3
|
+
|
|
4
|
+
const java = require('java');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Interface for complex codetext used with ComplexBarcodeGenerator.
|
|
9
|
+
*/
|
|
10
|
+
class IComplexCodetext extends joint.BaseJavaClass
|
|
11
|
+
{
|
|
12
|
+
constructor(javaClass)
|
|
13
|
+
{
|
|
14
|
+
super(javaClass);
|
|
15
|
+
this.init();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Construct codetext for complex barcode
|
|
20
|
+
* @return Constructed codetext
|
|
21
|
+
*/
|
|
22
|
+
getConstructedCodetext()
|
|
23
|
+
{
|
|
24
|
+
throw new BarcodeException('You have to implement the method getConstructedCodetext!');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Initializes instance with constructed codetext.
|
|
29
|
+
* @param constructedCodetext Constructed codetext.
|
|
30
|
+
*/
|
|
31
|
+
initFromString(constructedCodetext)
|
|
32
|
+
{
|
|
33
|
+
throw new BarcodeException('You have to implement the method initFromString!');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Gets barcode type.
|
|
38
|
+
* @return Barcode type.
|
|
39
|
+
*/
|
|
40
|
+
getBarcodeType()
|
|
41
|
+
{
|
|
42
|
+
throw new BarcodeException('You have to implement the method getBarcodeType!');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* ComplexBarcodeGenerator for backend complex barcode (e.g. SwissQR) images generation.
|
|
48
|
+
*
|
|
49
|
+
* This sample shows how to create and save a SwissQR image.
|
|
50
|
+
* let swissQRCodetext = new SwissQRCodetext(null);
|
|
51
|
+
* swissQRCodetext.getBill().setAccount("Account");
|
|
52
|
+
* swissQRCodetext.getBill().setBillInformation("BillInformation");
|
|
53
|
+
* swissQRCodetext.getBill().setBillInformation("BillInformation");
|
|
54
|
+
* swissQRCodetext.getBill().setAmount(1024);
|
|
55
|
+
* swissQRCodetext.getBill().getCreditor().setName("Creditor.Name");
|
|
56
|
+
* swissQRCodetext.getBill().getCreditor().setAddressLine1("Creditor.AddressLine1");
|
|
57
|
+
* swissQRCodetext.getBill().getCreditor().setAddressLine2("Creditor.AddressLine2");
|
|
58
|
+
* swissQRCodetext.getBill().getCreditor().setCountryCode("Nl");
|
|
59
|
+
* swissQRCodetext.getBill().setUnstructuredMessage("UnstructuredMessage");
|
|
60
|
+
* swissQRCodetext.getBill().setReference("Reference");
|
|
61
|
+
* swissQRCodetext.getBill().setAlternativeSchemes([new AlternativeScheme("AlternativeSchemeInstruction1"),new AlternativeScheme("AlternativeSchemeInstruction2")]);
|
|
62
|
+
* swissQRCodetext.getBill().setDebtor(new Address(null));
|
|
63
|
+
* swissQRCodetext.getBill().getDebtor().setName("Debtor.Name");
|
|
64
|
+
* swissQRCodetext.getBill().getDebtor().setAddressLine1("Debtor.AddressLine1");
|
|
65
|
+
* swissQRCodetext.getBill().getDebtor().setAddressLine2("Debtor.AddressLine2");
|
|
66
|
+
* swissQRCodetext.getBill().getDebtor().setCountryCode("Lux");
|
|
67
|
+
* let cg = new ComplexBarcodeGenerator(swissQRCodetext);
|
|
68
|
+
* let res = cg.generateBarCodeImage();
|
|
69
|
+
*/
|
|
70
|
+
class ComplexBarcodeGenerator extends joint.BaseJavaClass {
|
|
71
|
+
static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwComplexBarcodeGenerator";
|
|
72
|
+
parameters;
|
|
73
|
+
|
|
74
|
+
init() {
|
|
75
|
+
this.parameters = new generation.BaseGenerationParameters(this.getJavaClass().getParametersSync());
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Generation parameters.
|
|
80
|
+
*/
|
|
81
|
+
getParameters() {
|
|
82
|
+
return this.parameters;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Creates an instance of ComplexBarcodeGenerator.
|
|
87
|
+
* @param complexCodetext Complex codetext
|
|
88
|
+
*/
|
|
89
|
+
constructor(complexCodetext)
|
|
90
|
+
{
|
|
91
|
+
let java_class_link = java.import(ComplexBarcodeGenerator.javaClassName);
|
|
92
|
+
super(new java_class_link(complexCodetext.getJavaClass()));
|
|
93
|
+
this.init();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Generates complex barcode image under current settings.
|
|
98
|
+
* @return Base64 presentation of image.
|
|
99
|
+
*/
|
|
100
|
+
generateBarCodeImage(format) {
|
|
101
|
+
let base64Image = this.getJavaClass().generateBarCodeImageSync(format);
|
|
102
|
+
return base64Image;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* <p>
|
|
107
|
+
* Generates and saves complex barcode image under current settings.
|
|
108
|
+
* </p>
|
|
109
|
+
* @param filePath Path to save to.
|
|
110
|
+
* @param format BarCodeImageFormat(PNG, BMP, JPEG, GIF)
|
|
111
|
+
*/
|
|
112
|
+
save(filePath, format) {
|
|
113
|
+
let image64 = this.generateBarcodeImage(format);
|
|
114
|
+
let buff = Buffer.from(image64, 'base64');
|
|
115
|
+
fs.writeFileSync(filePath, buff);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Address of creditor or debtor.
|
|
121
|
+
*
|
|
122
|
+
* You can either set street, house number, postal code and town (type structured address)
|
|
123
|
+
* or address line 1 and 2 (type combined address elements). The type is automatically set
|
|
124
|
+
* once any of these fields is set. Before setting the fields, the address type is undetermined.
|
|
125
|
+
* If fields of both types are set, the address type becomes conflicting.
|
|
126
|
+
* Name and country code must always be set unless all fields are empty.
|
|
127
|
+
*/
|
|
128
|
+
class Address extends joint.BaseJavaClass {
|
|
129
|
+
static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwAddress";
|
|
130
|
+
|
|
131
|
+
constructor(arg) {
|
|
132
|
+
super(Address.initAddress(arg));
|
|
133
|
+
this.init();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
static initAddress(arg) {
|
|
137
|
+
if (arg == null) {
|
|
138
|
+
let javaAddress = java.import(Address.javaClassName);
|
|
139
|
+
return new javaAddress();
|
|
140
|
+
}
|
|
141
|
+
return arg;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Gets the address type.
|
|
146
|
+
*
|
|
147
|
+
* The address type is automatically set by either setting street / house number
|
|
148
|
+
* or address line 1 and 2. Before setting the fields, the address type is Undetermined.
|
|
149
|
+
* If fields of both types are set, the address type becomes Conflicting.
|
|
150
|
+
*
|
|
151
|
+
* Value: The address type.
|
|
152
|
+
*/
|
|
153
|
+
getType() {
|
|
154
|
+
return this.getJavaClass().getTypeSync();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Gets the name, either the first and last name of a natural person or the
|
|
159
|
+
* company name of a legal person.
|
|
160
|
+
* Value: The name.
|
|
161
|
+
*/
|
|
162
|
+
getName() {
|
|
163
|
+
return this.getJavaClass().getNameSync();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Sets the name, either the first and last name of a natural person or the
|
|
168
|
+
* company name of a legal person.
|
|
169
|
+
* Value: The name.
|
|
170
|
+
*/
|
|
171
|
+
setName(value) {
|
|
172
|
+
this.getJavaClass().setNameSync(value);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Gets the address line 1.
|
|
177
|
+
*
|
|
178
|
+
* Address line 1 contains street name, house number or P.O. box.
|
|
179
|
+
*
|
|
180
|
+
* Setting this field sets the address type to AddressType.COMBINED_ELEMENTS unless it's already
|
|
181
|
+
* AddressType.STRUCTURED, in which case it becomes AddressType.CONFLICTING.
|
|
182
|
+
*
|
|
183
|
+
* This field is only used for combined elements addresses and is optional.
|
|
184
|
+
*
|
|
185
|
+
* Value: The address line 1.
|
|
186
|
+
*/
|
|
187
|
+
getAddressLine1() {
|
|
188
|
+
return this.getJavaClass().getAddressLine1Sync();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Sets the address line 1.
|
|
193
|
+
*
|
|
194
|
+
* Address line 1 contains street name, house number or P.O. box.
|
|
195
|
+
*
|
|
196
|
+
* Setting this field sets the address type to AddressType.COMBINED_ELEMENTS unless it's already
|
|
197
|
+
* AddressType.STRUCTURED, in which case it becomes AddressType.CONFLICTING.
|
|
198
|
+
*
|
|
199
|
+
* This field is only used for combined elements addresses and is optional.
|
|
200
|
+
*
|
|
201
|
+
* Value: The address line 1.
|
|
202
|
+
*/
|
|
203
|
+
setAddressLine1(value) {
|
|
204
|
+
this.getJavaClass().setAddressLine1Sync(value);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Gets the address line 2.
|
|
209
|
+
* Address line 2 contains postal code and town.
|
|
210
|
+
* Setting this field sets the address type to AddressType.COMBINED_ELEMENTS unless it's already
|
|
211
|
+
* AddressType.STRUCTURED, in which case it becomes AddressType.CONFLICTING.
|
|
212
|
+
* This field is only used for combined elements addresses. For this type, it's mandatory.
|
|
213
|
+
* Value: The address line 2.
|
|
214
|
+
*/
|
|
215
|
+
getAddressLine2() {
|
|
216
|
+
return this.getJavaClass().getAddressLine2Sync();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Sets the address line 2.
|
|
221
|
+
* Address line 2 contains postal code and town.
|
|
222
|
+
* Setting this field sets the address type to AddressType.COMBINED_ELEMENTS unless it's already
|
|
223
|
+
* AddressType.STRUCTURED, in which case it becomes AddressType.CONFLICTING.
|
|
224
|
+
* This field is only used for combined elements addresses. For this type, it's mandatory.
|
|
225
|
+
* Value: The address line 2.
|
|
226
|
+
*/
|
|
227
|
+
setAddressLine2(value) {
|
|
228
|
+
this.getJavaClass().setAddressLine2Sync(value);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Gets the street.
|
|
233
|
+
* The street must be speicfied without house number.
|
|
234
|
+
* Setting this field sets the address type to AddressType.STRUCTURED unless it's already
|
|
235
|
+
* AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.
|
|
236
|
+
* This field is only used for structured addresses and is optional.
|
|
237
|
+
* Value: The street.
|
|
238
|
+
*/
|
|
239
|
+
getStreet() {
|
|
240
|
+
return this.getJavaClass().getStreetSync();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Sets the street.
|
|
245
|
+
*
|
|
246
|
+
* The street must be speicfied without house number.
|
|
247
|
+
*
|
|
248
|
+
* Setting this field sets the address type to AddressType.STRUCTURED unless it's already
|
|
249
|
+
* AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.
|
|
250
|
+
*
|
|
251
|
+
* This field is only used for structured addresses and is optional.
|
|
252
|
+
*
|
|
253
|
+
* Value: The street.
|
|
254
|
+
*/
|
|
255
|
+
setStreet(value) {
|
|
256
|
+
this.getJavaClass().setStreetSync(value);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Gets the house number.
|
|
261
|
+
*
|
|
262
|
+
* Setting this field sets the address type to AddressType.STRUCTURED unless it's already
|
|
263
|
+
* AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.
|
|
264
|
+
*
|
|
265
|
+
* This field is only used for structured addresses and is optional.
|
|
266
|
+
*
|
|
267
|
+
* Value: The house number.
|
|
268
|
+
*/
|
|
269
|
+
getHouseNo() {
|
|
270
|
+
return this.getJavaClass().getHouseNoSync();
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Sets the house number.
|
|
275
|
+
*
|
|
276
|
+
* Setting this field sets the address type to AddressType.STRUCTURED unless it's already
|
|
277
|
+
* AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.
|
|
278
|
+
*
|
|
279
|
+
* This field is only used for structured addresses and is optional.
|
|
280
|
+
*
|
|
281
|
+
* Value: The house number.
|
|
282
|
+
*/
|
|
283
|
+
setHouseNo(value) {
|
|
284
|
+
this.getJavaClass().setHouseNoSync(value);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Gets the postal code.
|
|
289
|
+
*
|
|
290
|
+
* Setting this field sets the address type to AddressType.STRUCTURED unless it's already
|
|
291
|
+
* AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.
|
|
292
|
+
*
|
|
293
|
+
* This field is only used for structured addresses. For this type, it's mandatory.
|
|
294
|
+
*
|
|
295
|
+
* Value: The postal code.
|
|
296
|
+
*/
|
|
297
|
+
getPostalCode() {
|
|
298
|
+
return this.getJavaClass().getPostalCodeSync();
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Sets the postal code.
|
|
303
|
+
*
|
|
304
|
+
* Setting this field sets the address type to AddressType.STRUCTURED unless it's already
|
|
305
|
+
* AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.
|
|
306
|
+
*
|
|
307
|
+
* This field is only used for structured addresses. For this type, it's mandatory.
|
|
308
|
+
*
|
|
309
|
+
* Value: The postal code.
|
|
310
|
+
*/
|
|
311
|
+
setPostalCode(value) {
|
|
312
|
+
this.getJavaClass().setPostalCodeSync(value);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Gets the town or city.
|
|
317
|
+
*
|
|
318
|
+
* Setting this field sets the address type to AddressType.STRUCTURED unless it's already
|
|
319
|
+
* AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.
|
|
320
|
+
*
|
|
321
|
+
* This field is only used for structured addresses. For this type, it's mandatory.
|
|
322
|
+
*
|
|
323
|
+
* Value: The town or city.
|
|
324
|
+
*/
|
|
325
|
+
getTown() {
|
|
326
|
+
return this.getJavaClass().getTownSync();
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Sets the town or city.
|
|
331
|
+
*
|
|
332
|
+
* Setting this field sets the address type to AddressType.STRUCTURED unless it's already
|
|
333
|
+
* AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.
|
|
334
|
+
*
|
|
335
|
+
* This field is only used for structured addresses. For this type, it's mandatory.
|
|
336
|
+
*
|
|
337
|
+
* Value: The town or city.
|
|
338
|
+
*/
|
|
339
|
+
setTown(value) {
|
|
340
|
+
this.getJavaClass().setTownSync(value);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Gets the two-letter ISO country code.
|
|
345
|
+
*
|
|
346
|
+
* The country code is mandatory unless the entire address contains null or emtpy values.
|
|
347
|
+
*
|
|
348
|
+
* Value: The ISO country code.
|
|
349
|
+
*/
|
|
350
|
+
getCountryCode() {
|
|
351
|
+
return this.getJavaClass().getCountryCodeSync();
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Sets the two-letter ISO country code.
|
|
356
|
+
*
|
|
357
|
+
* The country code is mandatory unless the entire address contains null or emtpy values.
|
|
358
|
+
*
|
|
359
|
+
* Value: The ISO country code.
|
|
360
|
+
*/
|
|
361
|
+
setCountryCode(value) {
|
|
362
|
+
this.getJavaClass().setCountryCodeSync(value);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Clears all fields and sets the type to AddressType.UNDETERMINED.
|
|
367
|
+
*/
|
|
368
|
+
clear() {
|
|
369
|
+
this.setName(null);
|
|
370
|
+
this.setAddressLine1(null);
|
|
371
|
+
this.setaddressLine2(null);
|
|
372
|
+
this.setStreet(null);
|
|
373
|
+
this.setHouseNo(null);
|
|
374
|
+
this.setPostalCode(null);
|
|
375
|
+
this.setTown(null);
|
|
376
|
+
this.setCountryCode(null);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Determines whether the specified object is equal to the current object.
|
|
381
|
+
* @return true if the specified object is equal to the current object; otherwise, false.
|
|
382
|
+
* @param obj The object to compare with the current object.
|
|
383
|
+
*/
|
|
384
|
+
equals(obj) {
|
|
385
|
+
return this.getJavaClass().equalsSync(obj.getJavaClass());
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Gets the hash code for this instance.
|
|
390
|
+
* @return A hash code for the current object.
|
|
391
|
+
*/
|
|
392
|
+
hashCode() {
|
|
393
|
+
return this.getJavaClass().hashCodeSync();
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
init() {
|
|
397
|
+
// TODO: Implement init() method.
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Address type
|
|
403
|
+
* @enum
|
|
404
|
+
*/
|
|
405
|
+
AddressType =
|
|
406
|
+
{
|
|
407
|
+
/**
|
|
408
|
+
* Undetermined
|
|
409
|
+
*/
|
|
410
|
+
UNDETERMINED: "0",
|
|
411
|
+
/**
|
|
412
|
+
* Structured address
|
|
413
|
+
*/
|
|
414
|
+
STRUCTURED: "1",
|
|
415
|
+
/**
|
|
416
|
+
* Combined address elements
|
|
417
|
+
*/
|
|
418
|
+
COMBINED_ELEMENTS: "2",
|
|
419
|
+
/**
|
|
420
|
+
* Conflicting
|
|
421
|
+
*/
|
|
422
|
+
CONFLICTING: "3"
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Alternative payment scheme instructions
|
|
427
|
+
*/
|
|
428
|
+
class AlternativeScheme extends joint.BaseJavaClass {
|
|
429
|
+
static get javaClassName() {
|
|
430
|
+
return "com.aspose.mw.barcode.complexbarcode.MwAlternativeScheme";
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
constructor(instruction)
|
|
434
|
+
{
|
|
435
|
+
let javaAlternativeScheme = java.import(AlternativeScheme.javaClassName);
|
|
436
|
+
super(new javaAlternativeScheme(instruction));
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
static construct(javaClass)
|
|
440
|
+
{
|
|
441
|
+
let jsClass = new AlternativeScheme("");
|
|
442
|
+
jsClass.setJavaClass(javaClass);
|
|
443
|
+
return jsClass;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Gets the payment instruction for a given bill.
|
|
448
|
+
*
|
|
449
|
+
* The instruction consists of a two letter abbreviation for the scheme, a separator characters
|
|
450
|
+
* and a sequence of parameters(separated by the character at index 2).
|
|
451
|
+
*
|
|
452
|
+
* Value: The payment instruction.
|
|
453
|
+
*/
|
|
454
|
+
getInstruction() {
|
|
455
|
+
return this.getJavaClass().getInstructionSync();
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Gets the payment instruction for a given bill.
|
|
460
|
+
* The instruction consists of a two letter abbreviation for the scheme, a separator characters
|
|
461
|
+
* and a sequence of parameters(separated by the character at index 2).
|
|
462
|
+
* Value: The payment instruction.
|
|
463
|
+
*/
|
|
464
|
+
setInstruction(value) {
|
|
465
|
+
this.getJavaClass().setInstructionSync(value);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Determines whether the specified object is equal to the current object.
|
|
470
|
+
* @return true if the specified object is equal to the current object; otherwise, false.
|
|
471
|
+
* @param obj The object to compare with the current object.
|
|
472
|
+
*/
|
|
473
|
+
equals(obj) {
|
|
474
|
+
return this.getJavaClass().equalsSync(obj.getJavaClass());
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Gets the hash code for this instance.
|
|
479
|
+
* @return hash code for the current object.
|
|
480
|
+
*/
|
|
481
|
+
hashCode() {
|
|
482
|
+
return this.getJavaClass().hashCodeSync();
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
init() {
|
|
486
|
+
// TODO: Implement init() method.
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* ComplexCodetextReader decodes codetext to specified complex barcode type.
|
|
492
|
+
*
|
|
493
|
+
* This sample shows how to recognize and decode SwissQR image.
|
|
494
|
+
*
|
|
495
|
+
* let cr = new BarCodeReader("SwissQRCodetext.png", DecodeType.QR);
|
|
496
|
+
* cr.read();
|
|
497
|
+
* let result = ComplexCodetextReader.tryDecodeSwissQR(cr.getCodeText(false));
|
|
498
|
+
*/
|
|
499
|
+
class ComplexCodetextReader {
|
|
500
|
+
static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwComplexCodetextReader";
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Decodes SwissQR codetext.
|
|
504
|
+
*
|
|
505
|
+
* @param encodedCodetext encoded codetext
|
|
506
|
+
* @return decoded SwissQRCodetext or null.
|
|
507
|
+
*/
|
|
508
|
+
static tryDecodeSwissQR(encodedCodetext) {
|
|
509
|
+
let javaJsComplexCodetextReader = java.import(ComplexCodetextReader.javaClassName);
|
|
510
|
+
return SwissQRCodetext.construct(javaJsComplexCodetextReader.tryDecodeSwissQRSync(encodedCodetext));
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Decodes Royal Mail Mailmark 2D codetext.
|
|
515
|
+
* @param encodedCodetext encoded codetext
|
|
516
|
+
* @return decoded Royal Mail Mailmark 2D or null.
|
|
517
|
+
*/
|
|
518
|
+
static tryDecodeMailmark2D(encodedCodetext)
|
|
519
|
+
{
|
|
520
|
+
let javaJsComplexCodetextReader = java.import(ComplexCodetextReader.javaClassName);
|
|
521
|
+
return Mailmark2DCodetext.construct(javaJsComplexCodetextReader.tryDecodeMailmark2DSync(encodedCodetext));
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Decodes Mailmark Barcode C and L codetext.
|
|
526
|
+
* @param encodedCodetext encoded codetext
|
|
527
|
+
* @return Decoded Mailmark Barcode C and L or null.
|
|
528
|
+
*/
|
|
529
|
+
static tryDecodeMailmark(encodedCodetext)
|
|
530
|
+
{
|
|
531
|
+
let res = new MailmarkCodetext(null);
|
|
532
|
+
try
|
|
533
|
+
{
|
|
534
|
+
res.initFromString(encodedCodetext);
|
|
535
|
+
}
|
|
536
|
+
catch (e)
|
|
537
|
+
{
|
|
538
|
+
return null;
|
|
539
|
+
}
|
|
540
|
+
return res;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* SwissQR bill standard version
|
|
546
|
+
* @enum
|
|
547
|
+
*/
|
|
548
|
+
QrBillStandardVersion =
|
|
549
|
+
{
|
|
550
|
+
/**
|
|
551
|
+
*
|
|
552
|
+
* Version 2.0
|
|
553
|
+
*
|
|
554
|
+
*/
|
|
555
|
+
V2_0: 0
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* SwissQR bill data
|
|
560
|
+
*/
|
|
561
|
+
class SwissQRBill extends joint.BaseJavaClass {
|
|
562
|
+
creditor;
|
|
563
|
+
debtor;
|
|
564
|
+
|
|
565
|
+
init() {
|
|
566
|
+
this.creditor = new Address(this.getJavaClass().getCreditorSync());
|
|
567
|
+
this.debtor = new Address(this.getJavaClass().getDebtorSync());
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
constructor(javaClass) {
|
|
571
|
+
super(javaClass);
|
|
572
|
+
this.init();
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
static convertAlternativeSchemes(javaAlternativeSchemes) {
|
|
576
|
+
let alternativeSchemes = [];
|
|
577
|
+
for (let i = 0; i < javaAlternativeSchemes.sizeSync(); i++) {
|
|
578
|
+
alternativeSchemes[i] = AlternativeScheme.construct(javaAlternativeSchemes.getSync(i));
|
|
579
|
+
}
|
|
580
|
+
return alternativeSchemes;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Gets the version of the SwissQR bill standard.
|
|
585
|
+
* Value: The SwissQR bill standard version.
|
|
586
|
+
*/
|
|
587
|
+
getVersion() {
|
|
588
|
+
return this.getJavaClass().getVersionSync();
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Sets the version of the SwissQR bill standard.
|
|
593
|
+
* Value: The SwissQR bill standard version.
|
|
594
|
+
*/
|
|
595
|
+
setVersion(value) {
|
|
596
|
+
this.getJavaClass().setVersionSync(value);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Gets the payment amount.
|
|
601
|
+
*
|
|
602
|
+
* Valid values are between 0.01 and 999,999,999.99.
|
|
603
|
+
*
|
|
604
|
+
* Value: The payment amount.
|
|
605
|
+
*/
|
|
606
|
+
getAmount() {
|
|
607
|
+
return this.getJavaClass().getAmountSync();
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Sets the payment amount.
|
|
612
|
+
*
|
|
613
|
+
* Valid values are between 0.01 and 999,999,999.99.
|
|
614
|
+
*
|
|
615
|
+
* Value: The payment amount.
|
|
616
|
+
*/
|
|
617
|
+
setAmount(value) {
|
|
618
|
+
this.getJavaClass().setAmountSync(value);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Gets the payment currency.
|
|
623
|
+
*
|
|
624
|
+
* Valid values are "CHF" and "EUR".
|
|
625
|
+
*
|
|
626
|
+
* Value: The payment currency.
|
|
627
|
+
*/
|
|
628
|
+
getCurrency() {
|
|
629
|
+
return this.getJavaClass().getCurrencySync();
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Sets the payment currency.
|
|
634
|
+
*
|
|
635
|
+
* Valid values are "CHF" and "EUR".
|
|
636
|
+
*
|
|
637
|
+
* Value: The payment currency.
|
|
638
|
+
*/
|
|
639
|
+
setCurrency(value) {
|
|
640
|
+
this.getJavaClass().setCurrencySync(value);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Gets the creditor's account number.
|
|
645
|
+
*
|
|
646
|
+
* Account numbers must be valid IBANs of a bank of Switzerland or
|
|
647
|
+
* Liechtenstein. Spaces are allowed in the account number.
|
|
648
|
+
*
|
|
649
|
+
* Value: The creditor account number.
|
|
650
|
+
*/
|
|
651
|
+
getAccount() {
|
|
652
|
+
return this.getJavaClass().getAccountSync();
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Sets the creditor's account number.
|
|
657
|
+
*
|
|
658
|
+
* Account numbers must be valid IBANs of a bank of Switzerland or
|
|
659
|
+
* Liechtenstein. Spaces are allowed in the account number.
|
|
660
|
+
*
|
|
661
|
+
* Value: The creditor account number.
|
|
662
|
+
*/
|
|
663
|
+
setAccount(value) {
|
|
664
|
+
this.getJavaClass().setAccountSync(value);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Gets the creditor address.
|
|
669
|
+
* Value: The creditor address.
|
|
670
|
+
*/
|
|
671
|
+
getCreditor() {
|
|
672
|
+
return this.creditor;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* Sets the creditor address.
|
|
677
|
+
* Value: The creditor address.
|
|
678
|
+
*/
|
|
679
|
+
setCreditor(value) {
|
|
680
|
+
this.creditor = value;
|
|
681
|
+
this.getJavaClass().setCreditorSync(value.getJavaClass());
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Gets the creditor payment reference.
|
|
686
|
+
*
|
|
687
|
+
* The reference is mandatory for SwissQR IBANs, i.e.IBANs in the range
|
|
688
|
+
* CHxx30000xxxxxx through CHxx31999xxxxx.
|
|
689
|
+
*
|
|
690
|
+
* If specified, the reference must be either a valid SwissQR reference
|
|
691
|
+
* (corresponding to ISR reference form) or a valid creditor reference
|
|
692
|
+
* according to ISO 11649 ("RFxxxx"). Both may contain spaces for formatting.
|
|
693
|
+
*
|
|
694
|
+
* Value: The creditor payment reference.
|
|
695
|
+
*/
|
|
696
|
+
getReference() {
|
|
697
|
+
return this.getJavaClass().getReferenceSync();
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Sets the creditor payment reference.
|
|
702
|
+
*
|
|
703
|
+
* The reference is mandatory for SwissQR IBANs, i.e.IBANs in the range
|
|
704
|
+
* CHxx30000xxxxxx through CHxx31999xxxxx.
|
|
705
|
+
*
|
|
706
|
+
* If specified, the reference must be either a valid SwissQR reference
|
|
707
|
+
* (corresponding to ISR reference form) or a valid creditor reference
|
|
708
|
+
* according to ISO 11649 ("RFxxxx"). Both may contain spaces for formatting.
|
|
709
|
+
*
|
|
710
|
+
* Value: The creditor payment reference.
|
|
711
|
+
*/
|
|
712
|
+
setReference(value) {
|
|
713
|
+
this.getJavaClass().setReferenceSync(value);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Creates and sets a ISO11649 creditor reference from a raw string by prefixing
|
|
718
|
+
* the String with "RF" and the modulo 97 checksum.
|
|
719
|
+
*
|
|
720
|
+
* Whitespace is removed from the reference
|
|
721
|
+
*
|
|
722
|
+
* @exception ArgumentException rawReference contains invalid characters.
|
|
723
|
+
* @param rawReference The raw reference.
|
|
724
|
+
*/
|
|
725
|
+
createAndSetCreditorReference(rawReference) {
|
|
726
|
+
this.getJavaClass().createAndSetCreditorReferenceSync(rawReference);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Gets the debtor address.
|
|
731
|
+
*
|
|
732
|
+
* The debtor is optional. If it is omitted, both setting this field to
|
|
733
|
+
* null or setting an address with all null or empty values is ok.
|
|
734
|
+
*
|
|
735
|
+
* Value: The debtor address.
|
|
736
|
+
*/
|
|
737
|
+
getDebtor() {
|
|
738
|
+
return this.debtor;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Sets the debtor address.
|
|
743
|
+
*
|
|
744
|
+
* The debtor is optional. If it is omitted, both setting this field to
|
|
745
|
+
* null or setting an address with all null or empty values is ok.
|
|
746
|
+
*
|
|
747
|
+
* Value: The debtor address.
|
|
748
|
+
*/
|
|
749
|
+
setDebtor(value) {
|
|
750
|
+
this.debtor = value;
|
|
751
|
+
this.getJavaClass().setDebtorSync(value.getJavaClass());
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* Gets the additional unstructured message.
|
|
756
|
+
* Value: The unstructured message.
|
|
757
|
+
*/
|
|
758
|
+
getUnstructuredMessage() {
|
|
759
|
+
return this.getJavaClass().getUnstructuredMessageSync();
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* Sets the additional unstructured message.
|
|
764
|
+
* Value: The unstructured message.
|
|
765
|
+
*/
|
|
766
|
+
setUnstructuredMessage(value) {
|
|
767
|
+
this.getJavaClass().setUnstructuredMessageSync(value);
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* Gets the additional structured bill information.
|
|
772
|
+
* Value: The structured bill information.
|
|
773
|
+
*/
|
|
774
|
+
getBillInformation() {
|
|
775
|
+
return this.getJavaClass().getBillInformationSync();
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Sets the additional structured bill information.
|
|
780
|
+
* Value: The structured bill information.
|
|
781
|
+
*/
|
|
782
|
+
setBillInformation(value) {
|
|
783
|
+
this.getJavaClass().setBillInformationSync(value);
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Gets ors sets the alternative payment schemes.
|
|
788
|
+
*
|
|
789
|
+
* A maximum of two schemes with parameters are allowed.
|
|
790
|
+
*
|
|
791
|
+
* Value: The alternative payment schemes.
|
|
792
|
+
*/
|
|
793
|
+
getAlternativeSchemes() {
|
|
794
|
+
return SwissQRBill.convertAlternativeSchemes(this.getJavaClass().getAlternativeSchemesSync());
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Gets or sets the alternative payment schemes.
|
|
799
|
+
*
|
|
800
|
+
* A maximum of two schemes with parameters are allowed.
|
|
801
|
+
*
|
|
802
|
+
* Value: The alternative payment schemes.
|
|
803
|
+
*/
|
|
804
|
+
setAlternativeSchemes(value) {
|
|
805
|
+
let ArrayList = java.import('java.util.ArrayList');
|
|
806
|
+
let javaArray = new ArrayList();
|
|
807
|
+
for(let i = 0; i < value.length; i++)
|
|
808
|
+
{
|
|
809
|
+
javaArray.addSync(value[i].getJavaClass());
|
|
810
|
+
}
|
|
811
|
+
this.getJavaClass().setAlternativeSchemesSync(javaArray);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* Determines whether the specified object is equal to the current object.
|
|
816
|
+
* @return true if the specified object is equal to the current object; otherwise, false.
|
|
817
|
+
* @param obj The object to compare with the current object.
|
|
818
|
+
*/
|
|
819
|
+
equals(obj) {
|
|
820
|
+
return this.getJavaClass().equalsSync(obj.getJavaClass());
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Gets the hash code for this instance.
|
|
825
|
+
* @return A hash code for the current object.
|
|
826
|
+
*/
|
|
827
|
+
hashCode() {
|
|
828
|
+
return this.getJavaClass().hashCodeSync();
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Class for encoding and decoding the text embedded in the SwissQR code.
|
|
834
|
+
*/
|
|
835
|
+
class SwissQRCodetext extends IComplexCodetext {
|
|
836
|
+
static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwSwissQRCodetext";
|
|
837
|
+
bill;
|
|
838
|
+
|
|
839
|
+
init() {
|
|
840
|
+
this.bill = new SwissQRBill(this.getJavaClass().getBillSync());
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* SwissQR bill data
|
|
845
|
+
*/
|
|
846
|
+
getBill() {
|
|
847
|
+
return this.bill;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* Creates an instance of SwissQRCodetext.
|
|
852
|
+
*
|
|
853
|
+
* @param bill SwissQR bill data
|
|
854
|
+
* @throws BarcodeException
|
|
855
|
+
*/
|
|
856
|
+
constructor(bill) {
|
|
857
|
+
let java_class_link = java.import(SwissQRCodetext.javaClassName);
|
|
858
|
+
let javaBill = null;
|
|
859
|
+
if (bill == null)
|
|
860
|
+
{
|
|
861
|
+
javaBill = new java_class_link();
|
|
862
|
+
}
|
|
863
|
+
else
|
|
864
|
+
{
|
|
865
|
+
javaBill = new java_class_link(bill.getJavaClass());
|
|
866
|
+
}
|
|
867
|
+
super(javaBill);
|
|
868
|
+
this.init();
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
static construct(javaClass)
|
|
872
|
+
{
|
|
873
|
+
let phpClass = new SwissQRCodetext(null);
|
|
874
|
+
phpClass.setJavaClass(javaClass);
|
|
875
|
+
return phpClass;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
/**
|
|
879
|
+
* Construct codetext from SwissQR bill data
|
|
880
|
+
*
|
|
881
|
+
* @return Constructed codetext
|
|
882
|
+
*/
|
|
883
|
+
getConstructedCodetext() {
|
|
884
|
+
return this.getJavaClass().getConstructedCodetextSync();
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* Initializes Bill with constructed codetext.
|
|
889
|
+
*
|
|
890
|
+
* @param constructedCodetext Constructed codetext.
|
|
891
|
+
*/
|
|
892
|
+
initFromString(constructedCodetext) {
|
|
893
|
+
this.getJavaClass().initFromStringSync(constructedCodetext);
|
|
894
|
+
this.init();
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* Gets barcode type.
|
|
899
|
+
*
|
|
900
|
+
* @return Barcode type.
|
|
901
|
+
*/
|
|
902
|
+
getBarcodeType() {
|
|
903
|
+
return this.getJavaClass().getBarcodeTypeSync();
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* Class for encoding and decoding the text embedded in the 4-state Royal Mailmark code.
|
|
910
|
+
*/
|
|
911
|
+
class MailmarkCodetext extends IComplexCodetext
|
|
912
|
+
{
|
|
913
|
+
static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwMailmarkCodetext";
|
|
914
|
+
/**
|
|
915
|
+
* "0" – Null or Test
|
|
916
|
+
* "1" – Letter
|
|
917
|
+
* "2" – Large Letter
|
|
918
|
+
*/
|
|
919
|
+
getFormat()
|
|
920
|
+
{ return this.getJavaClass().getFormatSync(); }
|
|
921
|
+
/**
|
|
922
|
+
* "0" – Null or Test
|
|
923
|
+
* "1" – LetterN
|
|
924
|
+
* "2" – Large Letter
|
|
925
|
+
*/
|
|
926
|
+
setFormat(value)
|
|
927
|
+
{ this.getJavaClass().setFormatSync(value); }
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* Currently "1" – For Mailmark barcode (0 and 2 to 9 and A to Z spare for future use)
|
|
931
|
+
*/
|
|
932
|
+
getVersionID()
|
|
933
|
+
{ return this.getJavaClass().getVersionIDSync(); }
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* Currently "1" – For Mailmark barcode (0 and 2 to 9 and A to Z spare for future use)
|
|
937
|
+
*/
|
|
938
|
+
setVersionID(value)
|
|
939
|
+
{ this.getJavaClass().setVersionIDSync(value); }
|
|
940
|
+
|
|
941
|
+
/**
|
|
942
|
+
* "0" - Null or Test
|
|
943
|
+
* "1" - 1C (Retail)
|
|
944
|
+
* "2" - 2C (Retail)
|
|
945
|
+
* "3" - 3C (Retail)
|
|
946
|
+
* "4" - Premium (RetailPublishing Mail) (for potential future use)
|
|
947
|
+
* "5" - Deferred (Retail)
|
|
948
|
+
* "6" - Air (Retail) (for potential future use)
|
|
949
|
+
* "7" - Surface (Retail) (for potential future use)
|
|
950
|
+
* "8" - Premium (Network Access)
|
|
951
|
+
* "9" - Standard (Network Access)
|
|
952
|
+
*/
|
|
953
|
+
getClass_()
|
|
954
|
+
{ return this.getJavaClass().getClass_Sync(); }
|
|
955
|
+
|
|
956
|
+
/**
|
|
957
|
+
* "0" - Null or Test
|
|
958
|
+
* "1" - 1C (Retail)
|
|
959
|
+
* "2" - 2C (Retail)
|
|
960
|
+
* "3" - 3C (Retail)
|
|
961
|
+
* "4" - Premium (RetailPublishing Mail) (for potential future use)
|
|
962
|
+
* "5" - Deferred (Retail)
|
|
963
|
+
* "6" - Air (Retail) (for potential future use)
|
|
964
|
+
* "7" - Surface (Retail) (for potential future use)
|
|
965
|
+
* "8" - Premium (Network Access)
|
|
966
|
+
* "9" - Standard (Network Access)
|
|
967
|
+
*/
|
|
968
|
+
setClass(value)
|
|
969
|
+
{ this.getJavaClass().setClassSync(value); }
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* Maximum values are 99 for Barcode C and 999999 for Barcode L.
|
|
973
|
+
*/
|
|
974
|
+
getSupplychainID()
|
|
975
|
+
{ return this.getJavaClass().getSupplychainIDSync(); }
|
|
976
|
+
/**
|
|
977
|
+
* Maximum values are 99 for Barcode C and 999999 for Barcode L.
|
|
978
|
+
*/
|
|
979
|
+
setSupplychainID(value)
|
|
980
|
+
{ this.getJavaClass().setSupplychainIDSync(value); }
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* Maximum value is 99999999.
|
|
984
|
+
*/
|
|
985
|
+
getItemID()
|
|
986
|
+
{ return this.getJavaClass().getItemIDSync(); }
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* Maximum value is 99999999.
|
|
990
|
+
*/
|
|
991
|
+
setItemID(value)
|
|
992
|
+
{ this.getJavaClass().setItemIDSync(value); }
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* The PC and DP must comply with a PAF format.
|
|
996
|
+
* Nine character string denoting international "XY11 " (note the 5 trailing spaces) or a pattern
|
|
997
|
+
* of characters denoting a domestic sorting code.
|
|
998
|
+
* A domestic sorting code consists of an outward postcode, an inward postcode, and a Delivery Point Suffix.
|
|
999
|
+
*/
|
|
1000
|
+
getDestinationPostCodePlusDPS()
|
|
1001
|
+
{ return this.getJavaClass().getDestinationPostCodePlusDPSSync(); }
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* The PC and DP must comply with a PAF format.
|
|
1005
|
+
* Nine character string denoting international "XY11 " (note the 5 trailing spaces) or a pattern
|
|
1006
|
+
* of characters denoting a domestic sorting code.
|
|
1007
|
+
* A domestic sorting code consists of an outward postcode, an inward postcode, and a Delivery Point Suffix.
|
|
1008
|
+
*/
|
|
1009
|
+
setDestinationPostCodePlusDPS(value)
|
|
1010
|
+
{ this.getJavaClass().setDestinationPostCodePlusDPSSync(value); }
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* Initializes a new instance of the {@code MailmarkCodetext} class.
|
|
1014
|
+
*/
|
|
1015
|
+
constructor(mailmarkCodetext)
|
|
1016
|
+
{
|
|
1017
|
+
let java_class_link = java.import(MailmarkCodetext.javaClassName);
|
|
1018
|
+
let javaClass = null;
|
|
1019
|
+
if (mailmarkCodetext == null)
|
|
1020
|
+
{
|
|
1021
|
+
javaClass = new java_class_link();
|
|
1022
|
+
}
|
|
1023
|
+
else
|
|
1024
|
+
{
|
|
1025
|
+
javaClass = new java_class_link(mailmarkCodetext.getJavaClass());
|
|
1026
|
+
}
|
|
1027
|
+
super(javaClass);
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
init()
|
|
1031
|
+
{}
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Construct codetext from Mailmark data.
|
|
1035
|
+
*
|
|
1036
|
+
* @return Constructed codetext
|
|
1037
|
+
*/
|
|
1038
|
+
getConstructedCodetext()
|
|
1039
|
+
{
|
|
1040
|
+
return this.getJavaClass().getConstructedCodetextSync();
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
/**
|
|
1044
|
+
* Initializes Mailmark data from constructed codetext.
|
|
1045
|
+
*
|
|
1046
|
+
* @param constructedCodetext Constructed codetext.
|
|
1047
|
+
*/
|
|
1048
|
+
initFromString(constructedCodetext)
|
|
1049
|
+
{
|
|
1050
|
+
this.getJavaClass().initFromStringSync(constructedCodetext);
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* Gets barcode type.
|
|
1055
|
+
*
|
|
1056
|
+
* @return Barcode type.
|
|
1057
|
+
*/
|
|
1058
|
+
getBarcodeType()
|
|
1059
|
+
{
|
|
1060
|
+
return this.getJavaClass().getBarcodeTypeSync();
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
class Mailmark2DCodetext extends IComplexCodetext
|
|
1065
|
+
{
|
|
1066
|
+
|
|
1067
|
+
static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwMailmark2DCodetext";
|
|
1068
|
+
|
|
1069
|
+
static construct(javaClass)
|
|
1070
|
+
{
|
|
1071
|
+
let jsClass = new Mailmark2DCodetext();
|
|
1072
|
+
jsClass.setJavaClass(javaClass);
|
|
1073
|
+
return jsClass;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* Identifies the UPU Country ID.Max length: 4 characters.
|
|
1078
|
+
* @return Country ID
|
|
1079
|
+
*/
|
|
1080
|
+
getUPUCountryID()
|
|
1081
|
+
{
|
|
1082
|
+
return this.getJavaClass().getUPUCountryIDSync();
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* Identifies the UPU Country ID.Max length: 4 characters.
|
|
1087
|
+
* @param value Country ID
|
|
1088
|
+
*/
|
|
1089
|
+
setUPUCountryID(value)
|
|
1090
|
+
{
|
|
1091
|
+
this.getJavaClass().setUPUCountryIDSync(value);
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* Identifies the Royal Mail Mailmark barcode payload for each product type.
|
|
1096
|
+
* Valid Values:
|
|
1097
|
+
*
|
|
1098
|
+
* '0' - Domestic Sorted & Unsorted
|
|
1099
|
+
* 'A' - Online Postage
|
|
1100
|
+
* 'B' - Franking
|
|
1101
|
+
* 'C' - Consolidation
|
|
1102
|
+
*
|
|
1103
|
+
* @return Information type ID
|
|
1104
|
+
*/
|
|
1105
|
+
getInformationTypeID()
|
|
1106
|
+
{
|
|
1107
|
+
return this.getJavaClass().getInformationTypeIDSync();
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* Identifies the Royal Mail Mailmark barcode payload for each product type.
|
|
1112
|
+
* Valid Values:
|
|
1113
|
+
*
|
|
1114
|
+
* '0' - Domestic Sorted & Unsorted
|
|
1115
|
+
* 'A' - Online Postage
|
|
1116
|
+
* 'B' - Franking
|
|
1117
|
+
* 'C' - Consolidation
|
|
1118
|
+
*
|
|
1119
|
+
* @param value Information type ID
|
|
1120
|
+
*/
|
|
1121
|
+
setInformationTypeID(value)
|
|
1122
|
+
{
|
|
1123
|
+
this.getJavaClass().setInformationTypeIDSync(value);
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* Identifies the barcode version as relevant to each Information Type ID.
|
|
1129
|
+
* Valid Values:
|
|
1130
|
+
*
|
|
1131
|
+
* Currently '1'.
|
|
1132
|
+
* '0' & '2' to '9' and 'A' to 'Z' spare reserved for potential future use.
|
|
1133
|
+
*
|
|
1134
|
+
* @return Version ID
|
|
1135
|
+
*/
|
|
1136
|
+
getVersionID()
|
|
1137
|
+
{
|
|
1138
|
+
return this.getJavaClass().getVersionIDSync();
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* Identifies the barcode version as relevant to each Information Type ID.
|
|
1143
|
+
* Valid Values:
|
|
1144
|
+
*
|
|
1145
|
+
* Currently '1'.
|
|
1146
|
+
* '0' & '2' to '9' and 'A' to 'Z' spare reserved for potential future use.
|
|
1147
|
+
*
|
|
1148
|
+
* @param value Version ID
|
|
1149
|
+
*/
|
|
1150
|
+
setVersionID(value)
|
|
1151
|
+
{
|
|
1152
|
+
this.getJavaClass().setVersionIDSync(value);
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* Identifies the class of the item.
|
|
1157
|
+
*
|
|
1158
|
+
* Valid Values:
|
|
1159
|
+
* '1' - 1C (Retail)
|
|
1160
|
+
* '2' - 2C (Retail)
|
|
1161
|
+
* '3' - Economy (Retail)
|
|
1162
|
+
* '5' - Deffered (Retail)
|
|
1163
|
+
* '8' - Premium (Network Access)
|
|
1164
|
+
* '9' - Standard (Network Access)
|
|
1165
|
+
*
|
|
1166
|
+
* @return class of the item
|
|
1167
|
+
*/
|
|
1168
|
+
getclass()
|
|
1169
|
+
{
|
|
1170
|
+
return this.getJavaClass().getclassSync();
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* Identifies the class of the item.
|
|
1175
|
+
*
|
|
1176
|
+
* Valid Values:
|
|
1177
|
+
* '1' - 1C (Retail)
|
|
1178
|
+
* '2' - 2C (Retail)
|
|
1179
|
+
* '3' - Economy (Retail)
|
|
1180
|
+
* '5' - Deffered (Retail)
|
|
1181
|
+
* '8' - Premium (Network Access)
|
|
1182
|
+
* '9' - Standard (Network Access)
|
|
1183
|
+
*
|
|
1184
|
+
* @param value class of the item
|
|
1185
|
+
*/
|
|
1186
|
+
setclass(value)
|
|
1187
|
+
{
|
|
1188
|
+
this.getJavaClass().setclassSync(value);
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* Identifies the unique group of customers involved in the mailing.
|
|
1193
|
+
* Max value: 9999999.
|
|
1194
|
+
*
|
|
1195
|
+
* @return Supply chain ID
|
|
1196
|
+
*/
|
|
1197
|
+
getSupplyChainID()
|
|
1198
|
+
{
|
|
1199
|
+
return this.getJavaClass().getSupplyChainIDSync();
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* Identifies the unique group of customers involved in the mailing.
|
|
1204
|
+
* Max value: 9999999.
|
|
1205
|
+
*
|
|
1206
|
+
* @param value Supply chain ID
|
|
1207
|
+
*/
|
|
1208
|
+
setSupplyChainID(value)
|
|
1209
|
+
{
|
|
1210
|
+
this.getJavaClass().setSupplyChainIDSync(value);
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Identifies the unique item within the Supply Chain ID.
|
|
1215
|
+
* Every Mailmark barcode is required to carry an ID
|
|
1216
|
+
* so it can be uniquely identified for at least 90 days.
|
|
1217
|
+
* Max value: 99999999.
|
|
1218
|
+
*
|
|
1219
|
+
* @return item within the Supply Chain ID
|
|
1220
|
+
*/
|
|
1221
|
+
getItemID()
|
|
1222
|
+
{
|
|
1223
|
+
return this.getJavaClass().getItemIDSync();
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
/**
|
|
1227
|
+
* Identifies the unique item within the Supply Chain ID.
|
|
1228
|
+
* Every Mailmark barcode is required to carry an ID
|
|
1229
|
+
* so it can be uniquely identified for at least 90 days.
|
|
1230
|
+
* Max value: 99999999.
|
|
1231
|
+
*
|
|
1232
|
+
* @param value item within the Supply Chain ID
|
|
1233
|
+
*/
|
|
1234
|
+
setItemID(value)
|
|
1235
|
+
{
|
|
1236
|
+
this.getJavaClass().setItemIDSync(value);
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Contains the Postcode of the Delivery Address with DPS
|
|
1241
|
+
* If inland the Postcode/DP contains the following number of characters.
|
|
1242
|
+
* Area (1 or 2 characters) District(1 or 2 characters)
|
|
1243
|
+
* Sector(1 character) Unit(2 characters) DPS (2 characters).
|
|
1244
|
+
* The Postcode and DPS must comply with a valid PAF® format.
|
|
1245
|
+
*
|
|
1246
|
+
* @return the Postcode of the Delivery Address with DPS
|
|
1247
|
+
*/
|
|
1248
|
+
getDestinationPostCodeAndDPS()
|
|
1249
|
+
{
|
|
1250
|
+
return this.getJavaClass().getDestinationPostCodeAndDPSSync();
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* Contains the Postcode of the Delivery Address with DPS
|
|
1255
|
+
* If inland the Postcode/DP contains the following number of characters.
|
|
1256
|
+
* Area (1 or 2 characters) District(1 or 2 characters)
|
|
1257
|
+
* Sector(1 character) Unit(2 characters) DPS (2 characters).
|
|
1258
|
+
* The Postcode and DPS must comply with a valid PAF® format.
|
|
1259
|
+
*
|
|
1260
|
+
* @param value the Postcode of the Delivery Address with DPS
|
|
1261
|
+
*/
|
|
1262
|
+
setDestinationPostCodeAndDPS(value)
|
|
1263
|
+
{
|
|
1264
|
+
this.getJavaClass().setDestinationPostCodeAndDPSSync(value);
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* Flag which indicates what level of Return to Sender service is being requested.
|
|
1269
|
+
*
|
|
1270
|
+
* @return RTS Flag
|
|
1271
|
+
*/
|
|
1272
|
+
getRTSFlag()
|
|
1273
|
+
{
|
|
1274
|
+
return this.getJavaClass().getRTSFlagSync();
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* Flag which indicates what level of Return to Sender service is being requested.
|
|
1279
|
+
*
|
|
1280
|
+
* @return RTS Flag
|
|
1281
|
+
*/
|
|
1282
|
+
setRTSFlag(value)
|
|
1283
|
+
{
|
|
1284
|
+
this.getJavaClass().setRTSFlagSync(value);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
/**
|
|
1288
|
+
* Contains the Return to Sender Post Code but no DPS.
|
|
1289
|
+
* The PC(without DPS) must comply with a PAF® format.
|
|
1290
|
+
*
|
|
1291
|
+
* @return Return to Sender Post Code but no DPS
|
|
1292
|
+
*/
|
|
1293
|
+
getReturnToSenderPostCode()
|
|
1294
|
+
{
|
|
1295
|
+
return this.getJavaClass().getReturnToSenderPostCodeSync();
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* Contains the Return to Sender Post Code but no DPS.
|
|
1300
|
+
* The PC(without DPS) must comply with a PAF® format.
|
|
1301
|
+
*
|
|
1302
|
+
* @param value Return to Sender Post Code but no DPS
|
|
1303
|
+
*/
|
|
1304
|
+
setReturnToSenderPostCode(value)
|
|
1305
|
+
{
|
|
1306
|
+
this.getJavaClass().setReturnToSenderPostCodeSync(value);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* Optional space for use by customer.
|
|
1311
|
+
*
|
|
1312
|
+
* Max length by Type:
|
|
1313
|
+
* Type 7: 6 characters
|
|
1314
|
+
* Type 9: 45 characters
|
|
1315
|
+
* Type 29: 25 characters
|
|
1316
|
+
*
|
|
1317
|
+
* @return Customer content
|
|
1318
|
+
*/
|
|
1319
|
+
getCustomerContent()
|
|
1320
|
+
{
|
|
1321
|
+
return this.getJavaClass().getCustomerContentSync();
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* Optional space for use by customer.
|
|
1326
|
+
*
|
|
1327
|
+
* Max length by Type:
|
|
1328
|
+
* Type 7: 6 characters
|
|
1329
|
+
* Type 9: 45 characters
|
|
1330
|
+
* Type 29: 25 characters
|
|
1331
|
+
*
|
|
1332
|
+
* @param value Customer content
|
|
1333
|
+
*/
|
|
1334
|
+
setCustomerContent(value)
|
|
1335
|
+
{
|
|
1336
|
+
this.getJavaClass().setCustomerContentSync(value);
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
/**
|
|
1340
|
+
* Encode mode of Datamatrix barcode.
|
|
1341
|
+
* Default value: DataMatrixEncodeMode.C40.
|
|
1342
|
+
*
|
|
1343
|
+
* @return Encode mode of Datamatrix barcode.
|
|
1344
|
+
*/
|
|
1345
|
+
getCustomerContentEncodeMode()
|
|
1346
|
+
{
|
|
1347
|
+
return this.getJavaClass().getCustomerContentEncodeModeSync();
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
/**
|
|
1351
|
+
* Encode mode of Datamatrix barcode.
|
|
1352
|
+
* Default value: DataMatrixEncodeMode.C40.
|
|
1353
|
+
*
|
|
1354
|
+
* @param value Encode mode of Datamatrix barcode.
|
|
1355
|
+
*/
|
|
1356
|
+
setCustomerContentEncodeMode(value)
|
|
1357
|
+
{
|
|
1358
|
+
this.getJavaClass().setCustomerContentEncodeModeSync(value);
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
/**
|
|
1362
|
+
* 2D Mailmark Type defines size of Data Matrix barcode.
|
|
1363
|
+
*
|
|
1364
|
+
* @return Size of Data Matrix barcode
|
|
1365
|
+
*/
|
|
1366
|
+
getDataMatrixType()
|
|
1367
|
+
{
|
|
1368
|
+
return this.getJavaClass().getDataMatrixTypeSync();
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
/**
|
|
1372
|
+
* 2D Mailmark Type defines size of Data Matrix barcode.
|
|
1373
|
+
*
|
|
1374
|
+
* @param value Size of Data Matrix barcode
|
|
1375
|
+
*/
|
|
1376
|
+
setDataMatrixType(value)
|
|
1377
|
+
{
|
|
1378
|
+
this.getJavaClass().setDataMatrixTypeSync(value);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* Create default instance of Mailmark2DCodetext class.
|
|
1383
|
+
*/
|
|
1384
|
+
constructor()
|
|
1385
|
+
{
|
|
1386
|
+
let java_class_link = java.import(Mailmark2DCodetext.javaClassName);
|
|
1387
|
+
super(new java_class_link());
|
|
1388
|
+
this.init();
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
init()
|
|
1392
|
+
{}
|
|
1393
|
+
|
|
1394
|
+
/**
|
|
1395
|
+
* Construct codetext from Mailmark data.
|
|
1396
|
+
* @return Constructed codetext
|
|
1397
|
+
*/
|
|
1398
|
+
getConstructedCodetext()
|
|
1399
|
+
{
|
|
1400
|
+
|
|
1401
|
+
return this.getJavaClass().getConstructedCodetextSync();
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
/**
|
|
1405
|
+
* Initializes Mailmark data from constructed codetext.
|
|
1406
|
+
* @param constructedCodetext Constructed codetext.
|
|
1407
|
+
*/
|
|
1408
|
+
initFromString(constructedCodetext)
|
|
1409
|
+
{
|
|
1410
|
+
this.getJavaClass().initFromStringSync(constructedCodetext);
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* Gets barcode type.
|
|
1415
|
+
* @return Barcode type.
|
|
1416
|
+
*/
|
|
1417
|
+
getBarcodeType() {
|
|
1418
|
+
return EncodeTypes.DATA_MATRIX;
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
/**
|
|
1423
|
+
* 2D Mailmark Type defines size of Data Matrix barcode
|
|
1424
|
+
* @enum
|
|
1425
|
+
*/
|
|
1426
|
+
Mailmark2DType =
|
|
1427
|
+
{
|
|
1428
|
+
/**
|
|
1429
|
+
* Auto determine
|
|
1430
|
+
*/
|
|
1431
|
+
AUTO: 0,
|
|
1432
|
+
|
|
1433
|
+
/**
|
|
1434
|
+
* 24 x 24 modules
|
|
1435
|
+
*/
|
|
1436
|
+
TYPE_7: 1,
|
|
1437
|
+
|
|
1438
|
+
/**
|
|
1439
|
+
* 32 x 32 modules
|
|
1440
|
+
*/
|
|
1441
|
+
TYPE_9: 2,
|
|
1442
|
+
|
|
1443
|
+
/**
|
|
1444
|
+
* 16 x 48 modules
|
|
1445
|
+
*/
|
|
1446
|
+
TYPE_29: 3
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
module.exports = {
|
|
1450
|
+
SwissQRCodetext,
|
|
1451
|
+
ComplexBarcodeGenerator,
|
|
1452
|
+
ComplexCodetextReader,
|
|
1453
|
+
AlternativeScheme,
|
|
1454
|
+
Address,
|
|
1455
|
+
AddressType,
|
|
1456
|
+
SwissQRBill,
|
|
1457
|
+
Mailmark2DCodetext,
|
|
1458
|
+
MailmarkCodetext,
|
|
1459
|
+
Mailmark2DType,
|
|
1460
|
+
QrBillStandardVersion
|
|
1461
|
+
};
|