aspose.barcode 20.12.7 → 21.3.7
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/lib/AsposeBarcode.js +1 -1
- package/lib/ComplexBarcode.js +2 -182
- package/lib/Generation.js +95 -168
- package/lib/Joint.js +1 -30
- package/lib/Recognition.js +43 -511
- package/lib/{aspose-barcode-nodejs-20.12.jar → aspose-barcode-nodejs-21.3.jar} +0 -0
- package/package.json +1 -1
package/lib/Recognition.js
CHANGED
|
@@ -16,8 +16,9 @@ const joint = require("./Joint");
|
|
|
16
16
|
class BarCodeReader extends joint.BaseJavaClass
|
|
17
17
|
{
|
|
18
18
|
qualitySettings;
|
|
19
|
+
barcodeRegion;
|
|
20
|
+
code128DataPortions;
|
|
19
21
|
recognizedResults;
|
|
20
|
-
barcodeSettings;
|
|
21
22
|
|
|
22
23
|
static get javaClassName()
|
|
23
24
|
{
|
|
@@ -34,9 +35,9 @@ class BarCodeReader extends joint.BaseJavaClass
|
|
|
34
35
|
{
|
|
35
36
|
if(image != null)
|
|
36
37
|
{
|
|
37
|
-
if (
|
|
38
|
+
if (BarCodeReader.isPath(image))
|
|
38
39
|
{
|
|
39
|
-
image =
|
|
40
|
+
image = BarCodeReader.loadImage(image);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
if (rectangles != null)
|
|
@@ -67,11 +68,7 @@ class BarCodeReader extends joint.BaseJavaClass
|
|
|
67
68
|
try
|
|
68
69
|
{
|
|
69
70
|
let java_class_link = new java.import(BarCodeReader.javaClassName);
|
|
70
|
-
let java_class =
|
|
71
|
-
if(image == null && rectangles == null && image == null)
|
|
72
|
-
java_class = new java_class_link();
|
|
73
|
-
else
|
|
74
|
-
java_class = new java_class_link(image, rectangles, decodeTypes);
|
|
71
|
+
let java_class = new java_class_link(image, rectangles, decodeTypes);
|
|
75
72
|
super(java_class);
|
|
76
73
|
this.init()
|
|
77
74
|
} catch (e)
|
|
@@ -81,11 +78,17 @@ class BarCodeReader extends joint.BaseJavaClass
|
|
|
81
78
|
}
|
|
82
79
|
}
|
|
83
80
|
|
|
84
|
-
static
|
|
81
|
+
static isPath(image)
|
|
85
82
|
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
if (image.length < 256 && image.includes("/") || image.includes("\\"))
|
|
84
|
+
{
|
|
85
|
+
if (fs.existsSync(image))
|
|
86
|
+
{
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
throw new joint.BarcodeException("Path " + image + " does not exist");
|
|
90
|
+
}
|
|
91
|
+
return false;
|
|
89
92
|
}
|
|
90
93
|
|
|
91
94
|
/**
|
|
@@ -102,6 +105,21 @@ class BarCodeReader extends joint.BaseJavaClass
|
|
|
102
105
|
return this.getJavaClass().containsAnySync(decodeTypes);
|
|
103
106
|
}
|
|
104
107
|
|
|
108
|
+
static loadImage(image)
|
|
109
|
+
{
|
|
110
|
+
let is_path_to_image = false;
|
|
111
|
+
is_path_to_image = fs.existsSync(image);
|
|
112
|
+
|
|
113
|
+
if (is_path_to_image)
|
|
114
|
+
{
|
|
115
|
+
return fs.readFileSync(image).toString('base64');
|
|
116
|
+
}
|
|
117
|
+
else
|
|
118
|
+
{
|
|
119
|
+
return image;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
105
123
|
static convertToString(arg)
|
|
106
124
|
{
|
|
107
125
|
if (is_int(arg))
|
|
@@ -134,7 +152,6 @@ class BarCodeReader extends joint.BaseJavaClass
|
|
|
134
152
|
init()
|
|
135
153
|
{
|
|
136
154
|
this.qualitySettings = new QualitySettings(this.getJavaClass().getQualitySettingsSync());
|
|
137
|
-
this.barcodeSettings = BarcodeSettings.construct(this.getJavaClass().getBarcodeSettingsSync());
|
|
138
155
|
}
|
|
139
156
|
|
|
140
157
|
/**
|
|
@@ -370,24 +387,13 @@ class BarCodeReader extends joint.BaseJavaClass
|
|
|
370
387
|
*/
|
|
371
388
|
readBarCodes()
|
|
372
389
|
{
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
let javaReadBarcodes = this.getJavaClass().readBarCodesSync();
|
|
377
|
-
for (let i = 0; i < javaReadBarcodes.length; i++)
|
|
378
|
-
{
|
|
379
|
-
this.recognizedResults[i] = new BarCodeResult(javaReadBarcodes[i]);
|
|
380
|
-
}
|
|
381
|
-
return this.recognizedResults;
|
|
382
|
-
}
|
|
383
|
-
catch (e)
|
|
390
|
+
this.recognizedResults = [];
|
|
391
|
+
let javaReadBarcodes = this.getJavaClass().readBarCodesSync();
|
|
392
|
+
for (let i = 0; i < javaReadBarcodes.length; i++)
|
|
384
393
|
{
|
|
385
|
-
|
|
386
|
-
{
|
|
387
|
-
throw new RecognitionAbortedException(e.toString(), null);
|
|
388
|
-
}
|
|
389
|
-
throw e;
|
|
394
|
+
this.recognizedResults[i] = new BarCodeResult(javaReadBarcodes[i]);
|
|
390
395
|
}
|
|
396
|
+
return this.recognizedResults;
|
|
391
397
|
}
|
|
392
398
|
|
|
393
399
|
/**
|
|
@@ -468,15 +474,6 @@ class BarCodeReader extends joint.BaseJavaClass
|
|
|
468
474
|
this.getJavaClass().setQualitySettingsSync(value.getJavaClass());
|
|
469
475
|
}
|
|
470
476
|
|
|
471
|
-
/**
|
|
472
|
-
* The main BarCode decoding parameters. Contains parameters which make influence on recognized data.
|
|
473
|
-
* @return The main BarCode decoding parameters
|
|
474
|
-
*/
|
|
475
|
-
getBarcodeSettings()
|
|
476
|
-
{
|
|
477
|
-
return this.barcodeSettings;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
477
|
/**
|
|
481
478
|
* A flag which force engine to detect codetext encoding for Unicode codesets.
|
|
482
479
|
* @example
|
|
@@ -557,7 +554,7 @@ class BarCodeReader extends joint.BaseJavaClass
|
|
|
557
554
|
*/
|
|
558
555
|
setBarCodeImage(image, ...areas)
|
|
559
556
|
{
|
|
560
|
-
image =
|
|
557
|
+
image = BarCodeReader.loadImage(image);
|
|
561
558
|
let stringAreas = [];
|
|
562
559
|
let isAllRectanglesNotNull = false;
|
|
563
560
|
if (!(areas == null) && areas.length > 0)
|
|
@@ -616,45 +613,13 @@ class BarCodeReader extends joint.BaseJavaClass
|
|
|
616
613
|
|
|
617
614
|
/**
|
|
618
615
|
* Exports BarCode properties to the xml-file specified
|
|
619
|
-
* @param xmlFile The name
|
|
616
|
+
* @param xmlFile The name for the file
|
|
620
617
|
* @return Whether or not export completed successfully.
|
|
621
618
|
* Returns True in case of success; False Otherwise
|
|
622
619
|
*/
|
|
623
620
|
exportToXml(xmlFile)
|
|
624
621
|
{
|
|
625
|
-
|
|
626
|
-
{
|
|
627
|
-
let xmlData = this.getJavaClass().exportToXmlSync();
|
|
628
|
-
let isSaved = xmlData != null;
|
|
629
|
-
if(isSaved)
|
|
630
|
-
fs.writeFileSync(xmlFile, xmlData);
|
|
631
|
-
return isSaved;
|
|
632
|
-
}
|
|
633
|
-
catch (ex)
|
|
634
|
-
{
|
|
635
|
-
let barcode_exception = new joint.BarcodeException(ex);
|
|
636
|
-
throw barcode_exception;
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
/**
|
|
641
|
-
* Exports BarCode properties to the xml-file specified
|
|
642
|
-
* @param xmlFile The name of the file
|
|
643
|
-
* @return Whether or not export completed successfully. Returns True in case of success; False Otherwise
|
|
644
|
-
*/
|
|
645
|
-
static importFromXml(xmlFile)
|
|
646
|
-
{
|
|
647
|
-
try
|
|
648
|
-
{
|
|
649
|
-
let xmlData = fs.readFileSync(xmlFile).toString();
|
|
650
|
-
let java_class_link = new java.import(BarCodeReader.javaClassName);
|
|
651
|
-
return BarCodeReader.construct(java_class_link.importFromXmlSync(xmlData.substring(3, xmlData.length)));
|
|
652
|
-
}
|
|
653
|
-
catch (ex)
|
|
654
|
-
{
|
|
655
|
-
let barcode_exception = new joint.BarcodeException(ex);
|
|
656
|
-
throw barcode_exception;
|
|
657
|
-
}
|
|
622
|
+
return this.getJavaClass().exportToXmlSync(xmlFile);
|
|
658
623
|
}
|
|
659
624
|
}
|
|
660
625
|
|
|
@@ -2140,7 +2105,7 @@ class QualitySettings extends joint.BaseJavaClass
|
|
|
2140
2105
|
|
|
2141
2106
|
/**
|
|
2142
2107
|
* Allows engine to recognize 1D barcodes with checksum by checking more recognition variants. Default value: False.
|
|
2143
|
-
* @param value If True, allows engine to recognize 1D barcodes with checksum.
|
|
2108
|
+
* @param $value If True, allows engine to recognize 1D barcodes with checksum.
|
|
2144
2109
|
*/
|
|
2145
2110
|
setCheckMore1DVariants(value)
|
|
2146
2111
|
{
|
|
@@ -2334,24 +2299,6 @@ class QualitySettings extends joint.BaseJavaClass
|
|
|
2334
2299
|
this.getJavaClass().setAllowMicroWhiteSpotsRemovingSync(value);
|
|
2335
2300
|
}
|
|
2336
2301
|
|
|
2337
|
-
/**
|
|
2338
|
-
* Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms.
|
|
2339
|
-
* @return Allows engine for 1D barcodes to quickly recognize high quality barcodes.
|
|
2340
|
-
*/
|
|
2341
|
-
getFastScanOnly()
|
|
2342
|
-
{
|
|
2343
|
-
return this.getJavaClass().getFastScanOnlySync();
|
|
2344
|
-
}
|
|
2345
|
-
|
|
2346
|
-
/**
|
|
2347
|
-
* Allows engine for 1D barcodes to quickly recognize middle slice of an image and return result without using any time-consuming algorithms.
|
|
2348
|
-
* @param value Allows engine for 1D barcodes to quickly recognize high quality barcodes.
|
|
2349
|
-
*/
|
|
2350
|
-
setFastScanOnly(value)
|
|
2351
|
-
{
|
|
2352
|
-
this.getJavaClass().setFastScanOnlySync(value);
|
|
2353
|
-
}
|
|
2354
|
-
|
|
2355
2302
|
/**
|
|
2356
2303
|
* Allows engine to recognize barcodes with salt and paper noise type. Mode can remove small noise with white and black dots.
|
|
2357
2304
|
* Value:
|
|
@@ -2635,374 +2582,6 @@ class DataBarExtendedParameters extends joint.BaseJavaClass
|
|
|
2635
2582
|
}
|
|
2636
2583
|
}
|
|
2637
2584
|
|
|
2638
|
-
/**
|
|
2639
|
-
* AustraliaPost decoding parameters. Contains parameters which make influence on recognized data of AustraliaPost symbology.
|
|
2640
|
-
*/
|
|
2641
|
-
class AustraliaPostSettings extends joint.BaseJavaClass
|
|
2642
|
-
{
|
|
2643
|
-
static get javaClassName()
|
|
2644
|
-
{
|
|
2645
|
-
return "com.aspose.mw.barcode.recognition.MwAustraliaPostSettings";
|
|
2646
|
-
}
|
|
2647
|
-
|
|
2648
|
-
init()
|
|
2649
|
-
{
|
|
2650
|
-
}
|
|
2651
|
-
|
|
2652
|
-
/**
|
|
2653
|
-
* AustraliaPostSettings constructor
|
|
2654
|
-
*/
|
|
2655
|
-
constructor(settings)
|
|
2656
|
-
{
|
|
2657
|
-
if (settings != null)
|
|
2658
|
-
{
|
|
2659
|
-
super(settings.getJavaClass());
|
|
2660
|
-
} else
|
|
2661
|
-
{
|
|
2662
|
-
let java_link = java.import(AustraliaPostSettings.javaClassName);
|
|
2663
|
-
let australiaPostSettings = new java_link();
|
|
2664
|
-
super(australiaPostSettings);
|
|
2665
|
-
}
|
|
2666
|
-
}
|
|
2667
|
-
|
|
2668
|
-
static construct(javaClass)
|
|
2669
|
-
{
|
|
2670
|
-
let australiaPostSettings = new AustraliaPostSettings(null);
|
|
2671
|
-
australiaPostSettings.setJavaClass(javaClass);
|
|
2672
|
-
return australiaPostSettings;
|
|
2673
|
-
}
|
|
2674
|
-
|
|
2675
|
-
/**
|
|
2676
|
-
* Gets or sets the Interpreting Type for the Customer Information of AustralianPost BarCode.DEFAULT is CustomerInformationInterpretingType.OTHER.
|
|
2677
|
-
* @return The interpreting type (CTable, NTable or Other) of customer information for AustralianPost BarCode
|
|
2678
|
-
*/
|
|
2679
|
-
getCustomerInformationInterpretingType()
|
|
2680
|
-
{
|
|
2681
|
-
return this.getJavaClass().getCustomerInformationInterpretingTypeSync();
|
|
2682
|
-
}
|
|
2683
|
-
|
|
2684
|
-
/**
|
|
2685
|
-
* Gets or sets the Interpreting Type for the Customer Information of AustralianPost BarCode.DEFAULT is CustomerInformationInterpretingType.OTHER.
|
|
2686
|
-
* @param value The interpreting type (CTable, NTable or Other) of customer information for AustralianPost BarCode
|
|
2687
|
-
*/
|
|
2688
|
-
setCustomerInformationInterpretingType(value)
|
|
2689
|
-
{
|
|
2690
|
-
this.getJavaClass().setCustomerInformationInterpretingTypeSync(value);
|
|
2691
|
-
}
|
|
2692
|
-
|
|
2693
|
-
/**
|
|
2694
|
-
* The flag which force AustraliaPost decoder to ignore last filling patterns in Customer Information Field during decoding as CTable method.
|
|
2695
|
-
* CTable encoding method does not have any gaps in encoding table and sequnce "333" of filling paterns is decoded as letter "z".
|
|
2696
|
-
*
|
|
2697
|
-
* Example
|
|
2698
|
-
*
|
|
2699
|
-
* let generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "5912345678AB");
|
|
2700
|
-
* generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.C_TABLE);
|
|
2701
|
-
* let image = generator.generateBarCodeImage(BarcodeImageFormat.PNG);
|
|
2702
|
-
* let reader = new BarCodeReader(image, null, DecodeType.AUSTRALIA_POST);
|
|
2703
|
-
* reader.getBarcodeSettings().getAustraliaPost().setCustomerInformationInterpretingType(CustomerInformationInterpretingType.C_TABLE);
|
|
2704
|
-
* reader.getBarcodeSettings().getAustraliaPost().setIgnoreEndingFillingPatternsForCTable(true);
|
|
2705
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
2706
|
-
* {
|
|
2707
|
-
* console.log("BarCode Type: ".result.getCodeType());
|
|
2708
|
-
* console.log("BarCode CodeText: ".result.getCodeText());
|
|
2709
|
-
* });
|
|
2710
|
-
*
|
|
2711
|
-
* @return The flag which force AustraliaPost decoder to ignore last filling patterns during CTable method decoding
|
|
2712
|
-
*/
|
|
2713
|
-
getIgnoreEndingFillingPatternsForCTable()
|
|
2714
|
-
{
|
|
2715
|
-
return this.getJavaClass().getIgnoreEndingFillingPatternsForCTableSync();
|
|
2716
|
-
}
|
|
2717
|
-
|
|
2718
|
-
setIgnoreEndingFillingPatternsForCTable(value)
|
|
2719
|
-
{
|
|
2720
|
-
this.getJavaClass().setIgnoreEndingFillingPatternsForCTableSync(value);
|
|
2721
|
-
}
|
|
2722
|
-
}
|
|
2723
|
-
|
|
2724
|
-
class BarcodeSettings extends joint.BaseJavaClass
|
|
2725
|
-
{
|
|
2726
|
-
|
|
2727
|
-
_australiaPost;
|
|
2728
|
-
|
|
2729
|
-
static get javaClassName()
|
|
2730
|
-
{
|
|
2731
|
-
return "com.aspose.mw.barcode.recognition.MwBarcodeSettings";
|
|
2732
|
-
}
|
|
2733
|
-
|
|
2734
|
-
/**
|
|
2735
|
-
* BarcodeSettings copy constructor
|
|
2736
|
-
* @param settings The source of the data
|
|
2737
|
-
*/
|
|
2738
|
-
constructor(settings)
|
|
2739
|
-
{
|
|
2740
|
-
if (settings != null)
|
|
2741
|
-
{
|
|
2742
|
-
super(settings.getJavaClass());
|
|
2743
|
-
} else
|
|
2744
|
-
{
|
|
2745
|
-
let java_link = java.import(BarcodeSettings.javaClassName);
|
|
2746
|
-
let barcodeSettings = new java_link();
|
|
2747
|
-
super(barcodeSettings);
|
|
2748
|
-
}
|
|
2749
|
-
}
|
|
2750
|
-
|
|
2751
|
-
/**
|
|
2752
|
-
* BarcodeSettings copy constructor
|
|
2753
|
-
* @param settings The source of the data
|
|
2754
|
-
*/
|
|
2755
|
-
static construct(javaClass)
|
|
2756
|
-
{
|
|
2757
|
-
let barcodeSettings = new BarcodeSettings(null);
|
|
2758
|
-
barcodeSettings.setJavaClass(javaClass);
|
|
2759
|
-
return barcodeSettings;
|
|
2760
|
-
}
|
|
2761
|
-
|
|
2762
|
-
init()
|
|
2763
|
-
{
|
|
2764
|
-
this._australiaPost = AustraliaPostSettings.construct(this.getJavaClass().getAustraliaPostSync());
|
|
2765
|
-
}
|
|
2766
|
-
|
|
2767
|
-
/**
|
|
2768
|
-
* Enable checksum validation during recognition for 1D and Postal barcodes.
|
|
2769
|
-
* Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.
|
|
2770
|
-
* Checksum never used: Codabar, PatchCode, Pharmacode, DataLogic2of5
|
|
2771
|
-
* Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, ItalianPost25, Matrix2of5, MSI, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN
|
|
2772
|
-
* Checksum always used: Rest symbologies
|
|
2773
|
-
*
|
|
2774
|
-
* Example
|
|
2775
|
-
*
|
|
2776
|
-
* let generator = new BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128");
|
|
2777
|
-
* generator.save("c:/test.png", BarcodeImageFormat.PNG);
|
|
2778
|
-
* let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
|
|
2779
|
-
* //checksum disabled
|
|
2780
|
-
* reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.OFF);
|
|
2781
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
2782
|
-
* {
|
|
2783
|
-
* console.log ("BarCode CodeText: ".result.getCodeText());
|
|
2784
|
-
* console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
|
|
2785
|
-
* console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
|
|
2786
|
-
* });
|
|
2787
|
-
* let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
|
|
2788
|
-
* //checksum enabled
|
|
2789
|
-
* reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.ON);
|
|
2790
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
2791
|
-
* {
|
|
2792
|
-
* console.log ("BarCode CodeText: " + result.CodeText);
|
|
2793
|
-
* console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
|
|
2794
|
-
* console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
|
|
2795
|
-
* });
|
|
2796
|
-
* @return Enable checksum validation during recognition for 1D and Postal barcodes.
|
|
2797
|
-
*/
|
|
2798
|
-
getChecksumValidation()
|
|
2799
|
-
{
|
|
2800
|
-
return this.getJavaClass().getChecksumValidationSync();
|
|
2801
|
-
}
|
|
2802
|
-
|
|
2803
|
-
/**
|
|
2804
|
-
* Enable checksum validation during recognition for 1D and Postal barcodes.
|
|
2805
|
-
* Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.
|
|
2806
|
-
* Checksum never used: Codabar, PatchCode, Pharmacode, DataLogic2of5
|
|
2807
|
-
* Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, ItalianPost25, Matrix2of5, MSI, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN
|
|
2808
|
-
* Checksum always used: Rest symbologies
|
|
2809
|
-
*
|
|
2810
|
-
* Example
|
|
2811
|
-
*
|
|
2812
|
-
* let generator = new BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128");
|
|
2813
|
-
* generator.save("c:/test.png", BarcodeImageFormat.PNG);
|
|
2814
|
-
* let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
|
|
2815
|
-
* //checksum disabled
|
|
2816
|
-
* reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.OFF);
|
|
2817
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
2818
|
-
* {
|
|
2819
|
-
* console.log ("BarCode CodeText: ".result.getCodeText());
|
|
2820
|
-
* console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
|
|
2821
|
-
* console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
|
|
2822
|
-
* });
|
|
2823
|
-
* let reader = new BarCodeReader("c:/test.png", DecodeType.EAN_13);
|
|
2824
|
-
* //checksum enabled
|
|
2825
|
-
* reader.getBarcodeSettings().setChecksumValidation(ChecksumValidation.ON);
|
|
2826
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
2827
|
-
* {
|
|
2828
|
-
* console.log ("BarCode CodeText: " + result.CodeText);
|
|
2829
|
-
* console.log ("BarCode Value: " + result.getExtended().getOneD().getValue());
|
|
2830
|
-
* console.log ("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
|
|
2831
|
-
* });
|
|
2832
|
-
* @param value Enable checksum validation during recognition for 1D and Postal barcodes.
|
|
2833
|
-
*/
|
|
2834
|
-
setChecksumValidation(value)
|
|
2835
|
-
{
|
|
2836
|
-
this.getJavaClass().setChecksumValidationSync(value);
|
|
2837
|
-
}
|
|
2838
|
-
|
|
2839
|
-
/**
|
|
2840
|
-
* Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
|
|
2841
|
-
*
|
|
2842
|
-
* Example
|
|
2843
|
-
*
|
|
2844
|
-
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_CODE_128, "(02)04006664241007(37)1(400)7019590754");
|
|
2845
|
-
* generator.save("c:/test.png", BarcodeImageFormat.PNG);
|
|
2846
|
-
* let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);
|
|
2847
|
-
*
|
|
2848
|
-
* //StripFNC disabled
|
|
2849
|
-
* reader.getBarcodeSettings().setStripFNC(false);
|
|
2850
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
2851
|
-
* {
|
|
2852
|
-
* console.log ("BarCode CodeText: ".result.getCodeText());
|
|
2853
|
-
* });
|
|
2854
|
-
*
|
|
2855
|
-
* let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);
|
|
2856
|
-
*
|
|
2857
|
-
* //StripFNC enabled
|
|
2858
|
-
* reader.getBarcodeSettings().setStripFNC(true);
|
|
2859
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
2860
|
-
* {
|
|
2861
|
-
* console.log ("BarCode CodeText: ".result.getCodeText());
|
|
2862
|
-
* });
|
|
2863
|
-
*
|
|
2864
|
-
* @return Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
|
|
2865
|
-
*/
|
|
2866
|
-
getStripFNC()
|
|
2867
|
-
{
|
|
2868
|
-
return this.getJavaClass().getStripFNCSync();
|
|
2869
|
-
}
|
|
2870
|
-
|
|
2871
|
-
/**
|
|
2872
|
-
* Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
|
|
2873
|
-
*
|
|
2874
|
-
* Example
|
|
2875
|
-
*
|
|
2876
|
-
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_CODE_128, "(02)04006664241007(37)1(400)7019590754");
|
|
2877
|
-
* generator.save("c:/test.png", BarcodeImageFormat.PNG);
|
|
2878
|
-
* let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);
|
|
2879
|
-
*
|
|
2880
|
-
* //StripFNC disabled
|
|
2881
|
-
* reader.getBarcodeSettings().setStripFNC(false);
|
|
2882
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
2883
|
-
* {
|
|
2884
|
-
* console.log ("BarCode CodeText: ".result.getCodeText());
|
|
2885
|
-
* });
|
|
2886
|
-
*
|
|
2887
|
-
* let reader = new BarCodeReader("c:/test.png", DecodeType.CODE_128);
|
|
2888
|
-
*
|
|
2889
|
-
* //StripFNC enabled
|
|
2890
|
-
* reader.getBarcodeSettings().setStripFNC(true);
|
|
2891
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
2892
|
-
* {
|
|
2893
|
-
* console.log ("BarCode CodeText: ".result.getCodeText());
|
|
2894
|
-
* });
|
|
2895
|
-
*
|
|
2896
|
-
* @param value Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
|
|
2897
|
-
*/
|
|
2898
|
-
setStripFNC(value)
|
|
2899
|
-
{
|
|
2900
|
-
this.getJavaClass().setStripFNCSync(value);
|
|
2901
|
-
}
|
|
2902
|
-
|
|
2903
|
-
/**
|
|
2904
|
-
* The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true.
|
|
2905
|
-
*
|
|
2906
|
-
* Example
|
|
2907
|
-
*
|
|
2908
|
-
* let generator = new BarcodeGenerator(EncodeTypes.QR, "Слово"))
|
|
2909
|
-
* $im = generator.generateBarcodeImage(BarcodeImageFormat.PNG);
|
|
2910
|
-
*
|
|
2911
|
-
* //detects encoding for Unicode codesets is enabled
|
|
2912
|
-
* let reader = new BarCodeReader(im, DecodeType.QR);
|
|
2913
|
-
* reader.getBarcodeSettings().setDetectEncoding(true);
|
|
2914
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
2915
|
-
* {
|
|
2916
|
-
* console.log ("BarCode CodeText: ".result.getCodeText());
|
|
2917
|
-
* });
|
|
2918
|
-
* //detect encoding is disabled
|
|
2919
|
-
* let reader = new BarCodeReader(im, DecodeType.QR);
|
|
2920
|
-
* reader.getBarcodeSettings().setDetectEncoding(false);
|
|
2921
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
2922
|
-
* console.log ("BarCode CodeText: " + result.getCodeText());
|
|
2923
|
-
*
|
|
2924
|
-
* @return The flag which force engine to detect codetext encoding for Unicode codesets
|
|
2925
|
-
*/
|
|
2926
|
-
getDetectEncoding()
|
|
2927
|
-
{
|
|
2928
|
-
return this.getJavaClass().getDetectEncodingSync();
|
|
2929
|
-
}
|
|
2930
|
-
|
|
2931
|
-
setDetectEncoding(value)
|
|
2932
|
-
{
|
|
2933
|
-
this.getJavaClass().setDetectEncodingSync(value);
|
|
2934
|
-
}
|
|
2935
|
-
|
|
2936
|
-
/**
|
|
2937
|
-
* Gets AustraliaPost decoding parameters
|
|
2938
|
-
* @return The AustraliaPost decoding parameters which make influence on recognized data of AustraliaPost symbology
|
|
2939
|
-
*/
|
|
2940
|
-
getAustraliaPost()
|
|
2941
|
-
{
|
|
2942
|
-
return this._australiaPost;
|
|
2943
|
-
}
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
class RecognitionAbortedException extends Error
|
|
2947
|
-
{
|
|
2948
|
-
javaClass;
|
|
2949
|
-
|
|
2950
|
-
static get javaClassName()
|
|
2951
|
-
{
|
|
2952
|
-
return "com.aspose.mw.barcode.recognition.MwRecognitionAbortedException";
|
|
2953
|
-
}
|
|
2954
|
-
/**
|
|
2955
|
-
* Gets the execution time of current recognition session
|
|
2956
|
-
* @return The execution time of current recognition session
|
|
2957
|
-
*/
|
|
2958
|
-
getExecutionTime()
|
|
2959
|
-
{
|
|
2960
|
-
return this.javaClass.getExecutionTimeSync();
|
|
2961
|
-
}
|
|
2962
|
-
|
|
2963
|
-
/**
|
|
2964
|
-
* Sets the execution time of current recognition session
|
|
2965
|
-
* @param value The execution time of current recognition session
|
|
2966
|
-
*/
|
|
2967
|
-
setExecutionTime(value)
|
|
2968
|
-
{
|
|
2969
|
-
this.javaClass.setExecutionTimeSync(value);
|
|
2970
|
-
}
|
|
2971
|
-
|
|
2972
|
-
/**
|
|
2973
|
-
* Initializes a new instance of the <see cref="RecognitionAbortedException" /> class with specified recognition abort message.
|
|
2974
|
-
* @param message The error message of the exception.
|
|
2975
|
-
* @param executionTime The execution time of current recognition session.
|
|
2976
|
-
*/
|
|
2977
|
-
constructor(message, executionTime)
|
|
2978
|
-
{
|
|
2979
|
-
super(message);
|
|
2980
|
-
let java_class_link = new java.import(RecognitionAbortedException.javaClassName);
|
|
2981
|
-
if(message != null && executionTime != null)
|
|
2982
|
-
{
|
|
2983
|
-
this.javaClass = new java_class_link(message, executionTime);
|
|
2984
|
-
}
|
|
2985
|
-
else if (executionTime != null)
|
|
2986
|
-
{
|
|
2987
|
-
this.javaClass = new java_class_link(executionTime);
|
|
2988
|
-
}
|
|
2989
|
-
else
|
|
2990
|
-
this.javaClass = new java_class_link();
|
|
2991
|
-
}
|
|
2992
|
-
|
|
2993
|
-
static construct(javaClass)
|
|
2994
|
-
{
|
|
2995
|
-
let exception = new RecognitionAbortedException(null, null);
|
|
2996
|
-
exception.javaClass = javaClass;
|
|
2997
|
-
return exception;
|
|
2998
|
-
}
|
|
2999
|
-
|
|
3000
|
-
init()
|
|
3001
|
-
{
|
|
3002
|
-
|
|
3003
|
-
}
|
|
3004
|
-
}
|
|
3005
|
-
|
|
3006
2585
|
/**
|
|
3007
2586
|
* Specify the type of barcode to read.
|
|
3008
2587
|
* @example
|
|
@@ -3212,10 +2791,6 @@ DecodeType =
|
|
|
3212
2791
|
* Specifies that the data should be decoded with {@code <b>CodablockF</b>} barcode specification
|
|
3213
2792
|
*/
|
|
3214
2793
|
CODABLOCK_F: 65,
|
|
3215
|
-
/**
|
|
3216
|
-
* Specifies that the data should be decoded with <b>Royal Mail Mailmark</b> barcode specification.
|
|
3217
|
-
*/
|
|
3218
|
-
MAILMARK: 66,
|
|
3219
2794
|
|
|
3220
2795
|
/**
|
|
3221
2796
|
* Specifies that the data should be decoded with {@code <b>Australia Post</b>} barcode specification
|
|
@@ -3360,7 +2935,7 @@ DecodeType =
|
|
|
3360
2935
|
/**
|
|
3361
2936
|
* Specifies that data will be checked with all available symbologies
|
|
3362
2937
|
*/
|
|
3363
|
-
ALL_SUPPORTED_TYPES:
|
|
2938
|
+
ALL_SUPPORTED_TYPES: 66,
|
|
3364
2939
|
|
|
3365
2940
|
/**
|
|
3366
2941
|
* Specifies that data will be checked with all of 1D barcode symbologies
|
|
@@ -3486,58 +3061,17 @@ Code128SubType =
|
|
|
3486
3061
|
* @enum
|
|
3487
3062
|
*/
|
|
3488
3063
|
CustomerInformationInterpretingType =
|
|
3489
|
-
{
|
|
3490
|
-
|
|
3064
|
+
{
|
|
3491
3065
|
/**
|
|
3492
3066
|
* Use C_TABLE to interpret the customer information. Allows A..Z, a..z, 1..9, space and # sing.
|
|
3493
|
-
*
|
|
3494
|
-
* @code
|
|
3495
|
-
* let generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "5912345678ABCde");
|
|
3496
|
-
* generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.C_TABLE);
|
|
3497
|
-
* let image = generator.generateBarcodeImage(BarcodeImageFormat.PNG);
|
|
3498
|
-
* let reader = new BarCodeReader(image, DecodeType.AUSTRALIA_POST);
|
|
3499
|
-
* reader.setCustomerInformationInterpretingType(CustomerInformationInterpretingType.C_TABLE);
|
|
3500
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
3501
|
-
* {
|
|
3502
|
-
* print("BarCode Type: " + result.getCodeType());
|
|
3503
|
-
* print("BarCode CodeText: " + result.getCodeText());
|
|
3504
|
-
* });
|
|
3505
|
-
* @endcode
|
|
3506
3067
|
*/
|
|
3507
3068
|
C_TABLE: 0,
|
|
3508
|
-
|
|
3509
3069
|
/**
|
|
3510
3070
|
* Use N_TABLE to interpret the customer information. Allows digits.
|
|
3511
|
-
*
|
|
3512
|
-
* @code
|
|
3513
|
-
* let generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "59123456781234567");
|
|
3514
|
-
* generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.N_TABLE);
|
|
3515
|
-
* let image = generator.generateBarcodeImage(BarcodeImageFormat.PNG);
|
|
3516
|
-
* let reader = new BarCodeReader(image, DecodeType.AUSTRALIA_POST);
|
|
3517
|
-
* reader.setCustomerInformationInterpretingType(CustomerInformationInterpretingType.N_TABLE);
|
|
3518
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
3519
|
-
* {
|
|
3520
|
-
* print("BarCode Type: " + result.getCodeType());
|
|
3521
|
-
* print("BarCode CodeText: " + result.getCodeText());
|
|
3522
|
-
* });
|
|
3523
|
-
* @endcode
|
|
3524
3071
|
*/
|
|
3525
3072
|
N_TABLE: 1,
|
|
3526
3073
|
/**
|
|
3527
3074
|
* Do not interpret the customer information. Allows 0, 1, 2 or 3 symbol only.
|
|
3528
|
-
*
|
|
3529
|
-
* @code
|
|
3530
|
-
* let generator = new BarcodeGenerator(EncodeTypes.AUSTRALIA_POST, "59123456780123012301230123");
|
|
3531
|
-
* generator.getParameters().getBarcode().getAustralianPost().setAustralianPostEncodingTable(CustomerInformationInterpretingType.OTHER);
|
|
3532
|
-
* let image = generator.generateBarcodeImage(BarcodeImageFormat.PNG);
|
|
3533
|
-
* let reader = new BarCodeReader(image, DecodeType.AUSTRALIA_POST);
|
|
3534
|
-
* reader.setCustomerInformationInterpretingType(CustomerInformationInterpretingType.OTHER));
|
|
3535
|
-
* reader.readBarCodes().forEach(function(result, i, results)
|
|
3536
|
-
* {
|
|
3537
|
-
* print("BarCode Type: " + result.getCodeType());
|
|
3538
|
-
* print("BarCode CodeText: " + result.getCodeText());
|
|
3539
|
-
* });
|
|
3540
|
-
* @endcode
|
|
3541
3075
|
*/
|
|
3542
3076
|
OTHER: 2,
|
|
3543
3077
|
};
|
|
@@ -3609,8 +3143,6 @@ module.exports = {
|
|
|
3609
3143
|
Code128SubType,
|
|
3610
3144
|
Code128DataPortion,
|
|
3611
3145
|
DataBarExtendedParameters,
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
CustomerInformationInterpretingType,
|
|
3615
|
-
RecognitionAbortedException
|
|
3146
|
+
|
|
3147
|
+
CustomerInformationInterpretingType
|
|
3616
3148
|
};
|
|
Binary file
|