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,75 @@
|
|
|
1
|
+
let libs_root = "../"
|
|
2
|
+
const index_path = libs_root + "index.js";
|
|
3
|
+
const barcode_ = require(index_path)
|
|
4
|
+
const aspose_barcode = barcode_.AsposeBarcode
|
|
5
|
+
//in case you obtained the lib from npmjs.com by calling the command "npm i aspose.barcode"
|
|
6
|
+
// replace all above lines by two lines
|
|
7
|
+
// const barcode_ = require("aspose.barcode");
|
|
8
|
+
// const aspose_barcode = barcode_.AsposeBarcode
|
|
9
|
+
|
|
10
|
+
const path_to_license_file = "./lic/Aspose.BarCode.Nodejs.via.Java.lic";
|
|
11
|
+
const fs = require("fs");
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
function setLicense()
|
|
15
|
+
{
|
|
16
|
+
let license = new aspose_barcode.License();
|
|
17
|
+
if (fs.existsSync(path_to_license_file))
|
|
18
|
+
{
|
|
19
|
+
license.setLicense(path_to_license_file);
|
|
20
|
+
}
|
|
21
|
+
else
|
|
22
|
+
{
|
|
23
|
+
console.log("Path \"" + path_to_license_file + "\" doesn't exist\n");
|
|
24
|
+
}
|
|
25
|
+
let is_licensed = license.isLicensed();
|
|
26
|
+
console.log('is licensed: ' + is_licensed);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isExists(file_path)
|
|
30
|
+
{
|
|
31
|
+
if (fs.existsSync(file_path))
|
|
32
|
+
{
|
|
33
|
+
console.log(file_path + " exists")
|
|
34
|
+
}
|
|
35
|
+
else
|
|
36
|
+
{
|
|
37
|
+
console.log(file_path + " doesn't exist")
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @param subFolder path to image
|
|
43
|
+
* @param fileName name of image
|
|
44
|
+
* @returns base64 encoded image
|
|
45
|
+
*/
|
|
46
|
+
function loadImageByName(subFolder, fileName)
|
|
47
|
+
{
|
|
48
|
+
let filePath = subFolder + "/" + fileName;
|
|
49
|
+
try
|
|
50
|
+
{
|
|
51
|
+
return fs.readFileSync(filePath).toString('base64');
|
|
52
|
+
} catch (ex)
|
|
53
|
+
{
|
|
54
|
+
console.error(ex.toString());
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function saveImageBase64(image64, path)
|
|
59
|
+
{
|
|
60
|
+
try
|
|
61
|
+
{
|
|
62
|
+
console.log("Will be saved to : " + path);
|
|
63
|
+
let image_bytes = Buffer.from(image64, 'base64');
|
|
64
|
+
fs.writeFileSync(path, image_bytes);
|
|
65
|
+
return fs.existsSync(path);
|
|
66
|
+
} catch (ex)
|
|
67
|
+
{
|
|
68
|
+
let barcode_exception = new barcodetestexception_.BarcodeTestException(ex);
|
|
69
|
+
throw barcode_exception;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
module.exports = {
|
|
74
|
+
aspose_barcode, setLicense, isExists, loadImageByName, saveImageBase64
|
|
75
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const ea = require("./ExamplesAssist")
|
|
3
|
+
const aspose_barcode = ea.aspose_barcode
|
|
4
|
+
let BarcodeGenerator = aspose_barcode.BarcodeGenerator;
|
|
5
|
+
let EncodeTypes = aspose_barcode.EncodeTypes;
|
|
6
|
+
let BarCodeReader = aspose_barcode.BarCodeReader;
|
|
7
|
+
|
|
8
|
+
function generateAndRead()
|
|
9
|
+
{
|
|
10
|
+
ea.setLicense();
|
|
11
|
+
let generator = new BarcodeGenerator(EncodeTypes.CODE_128, "12367891011");
|
|
12
|
+
let file_path = "resources/generating/setBarcodeType.png";
|
|
13
|
+
generator.save(file_path, aspose_barcode.BarCodeImageFormat.PNG);
|
|
14
|
+
|
|
15
|
+
let image_data_base64 = fs.readFileSync(file_path).toString('base64');
|
|
16
|
+
let reader = new BarCodeReader(image_data_base64, null, DecodeType.ALL_SUPPORTED_TYPES);
|
|
17
|
+
|
|
18
|
+
reader.readBarCodes().forEach(function(result, i, results)
|
|
19
|
+
{
|
|
20
|
+
console.log("Recognized barcode code text: " + result.getCodeText(false) + "\n");
|
|
21
|
+
console.log("Recognized barcode code type: " + result.getCodeTypeName() + "\n");
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
generateAndRead();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
1. If you're launching the tests outside of 'node_modules' folder, replace lines in 'ExamplesAssist.js'
|
|
2
|
+
Instead of first four lines should be added
|
|
3
|
+
const barcode_ = require("aspose.barcode");
|
|
4
|
+
const aspose_barcode = barcode_.AsposeBarcode
|
|
5
|
+
2. Run command 'npm install'
|
|
6
|
+
3. Put the license file 'Aspose.BarCode.Nodejs.via.Java.lic' to the folder lic.
|
|
7
|
+
4. Open and run every file consistently :
|
|
8
|
+
how_to_generate_and_read_example.js
|
|
9
|
+
how_to_generate_barcode_examples.js
|
|
10
|
+
how_to_read_barcode_examples.js
|
|
11
|
+
You can run them from the command line,
|
|
12
|
+
for example 'node how_to_generate_and_read_example.js.cmd'
|
|
13
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Place license to this folder
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Folder for generated files
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
const java = require('java');
|
|
3
|
+
const joint_ = require('./Joint');
|
|
4
|
+
const complexbarcode_ = require("./ComplexBarcode");
|
|
5
|
+
const generation_ = require("./Generation");
|
|
6
|
+
const recognition_ = require("./Recognition");
|
|
7
|
+
|
|
8
|
+
function pushJar()
|
|
9
|
+
{
|
|
10
|
+
java.classpath.push(__dirname + "/aspose-barcode-nodejs-20.6.jar");
|
|
11
|
+
}
|
|
12
|
+
pushJar();
|
|
13
|
+
|
|
14
|
+
module.exports = { complexbarcode_, recognition_, generation_,joint_,
|
|
15
|
+
BarcodeGenerator : generation_.BarcodeGenerator,
|
|
16
|
+
BarcodeParameters: generation_.BarcodeParameters,
|
|
17
|
+
BaseGenerationParameters : generation_.BaseGenerationParameters,
|
|
18
|
+
BorderParameters : generation_.BorderParameters,
|
|
19
|
+
ChecksumValidation:generation_.ChecksumValidation,
|
|
20
|
+
CaptionParameters: generation_.CaptionParameters,
|
|
21
|
+
Unit: generation_.Unit,
|
|
22
|
+
Padding: generation_.Padding,
|
|
23
|
+
CodetextParameters: generation_.CodetextParameters,
|
|
24
|
+
PostalParameters: generation_.PostalParameters,
|
|
25
|
+
AustralianPostParameters: generation_.AustralianPostParameters,
|
|
26
|
+
CodablockParameters: generation_.CodablockParameters,
|
|
27
|
+
DataBarParameters: generation_.DataBarParameters,
|
|
28
|
+
DataMatrixParameters: generation_.DataMatrixParameters,
|
|
29
|
+
PatchCodeParameters: generation_.PatchCodeParameters,
|
|
30
|
+
Code16KParameters: generation_.Code16KParameters,
|
|
31
|
+
DotCodeParameters: generation_.DotCodeParameters,
|
|
32
|
+
ITFParameters: generation_.ITFParameters,
|
|
33
|
+
QrParameters: generation_.QrParameters,
|
|
34
|
+
Pdf417Parameters: generation_.Pdf417Parameters,
|
|
35
|
+
SupplementParameters: generation_.SupplementParameters,
|
|
36
|
+
MaxiCodeParameters: generation_.MaxiCodeParameters,
|
|
37
|
+
AztecParameters: generation_.AztecParameters,
|
|
38
|
+
CodabarParameters: generation_.CodabarParameters,
|
|
39
|
+
CouponParameters: generation_.CouponParameters,
|
|
40
|
+
FontUnit: generation_.FontUnit,
|
|
41
|
+
ExtCodetextBuilder: generation_.ExtCodetextBuilder,
|
|
42
|
+
QrExtCodetextBuilder: generation_.QrExtCodetextBuilder,
|
|
43
|
+
QrStructuredAppendParameters: generation_.QrStructuredAppendParameters,
|
|
44
|
+
BarcodeClassifications: generation_.BarcodeClassifications,
|
|
45
|
+
FontStyle: generation_.FontStyle,
|
|
46
|
+
CodabarSymbol: generation_.CodabarSymbol,
|
|
47
|
+
DataMatrixEncodeMode: generation_.DataMatrixEncodeMode,
|
|
48
|
+
BorderDashStyle: generation_.BorderDashStyle,
|
|
49
|
+
ITF14BorderType: generation_.ITF14BorderType,
|
|
50
|
+
QREncodeMode: generation_.QREncodeMode,
|
|
51
|
+
DataMatrixEccType: generation_.DataMatrixEccType,
|
|
52
|
+
QRVersion: generation_.QRVersion,
|
|
53
|
+
AztecSymbolMode: generation_.AztecSymbolMode,
|
|
54
|
+
Pdf417ErrorLevel: generation_.Pdf417ErrorLevel,
|
|
55
|
+
Pdf417CompactionMode: generation_.Pdf417CompactionMode,
|
|
56
|
+
QRErrorLevel: generation_.QRErrorLevel,
|
|
57
|
+
QREncodeType: generation_.QREncodeType,
|
|
58
|
+
CodabarChecksumMode: generation_.CodabarChecksumMode,
|
|
59
|
+
CodeLocation: generation_.CodeLocation,
|
|
60
|
+
FontMode: generation_.FontMode,
|
|
61
|
+
TextAlignment: generation_.TextAlignment,
|
|
62
|
+
AutoSizeMode: generation_.AutoSizeMode,
|
|
63
|
+
GraphicsUnit: generation_.GraphicsUnit,
|
|
64
|
+
EncodeTypes: generation_.EncodeTypes,
|
|
65
|
+
MacroCharacter: generation_.MacroCharacter,
|
|
66
|
+
PatchFormat: generation_.PatchFormat,
|
|
67
|
+
ECIEncodings: generation_.ECIEncodings,
|
|
68
|
+
EnableChecksum: generation_.EnableChecksum,
|
|
69
|
+
BarCodeImageFormat: generation_.BarCodeImageFormat,
|
|
70
|
+
BarCodeReader: recognition_.BarCodeReader,
|
|
71
|
+
Quadrangle: recognition_.Quadrangle,
|
|
72
|
+
QRExtendedParameters: recognition_.QRExtendedParameters,
|
|
73
|
+
Pdf417ExtendedParameters: recognition_.Pdf417ExtendedParameters,
|
|
74
|
+
OneDExtendedParameters: recognition_.OneDExtendedParameters,
|
|
75
|
+
Code128ExtendedParameters: recognition_.Code128ExtendedParameters,
|
|
76
|
+
BarcodeSvmDetectorSettings: recognition_.BarcodeSvmDetectorSettings,
|
|
77
|
+
BarCodeResult: recognition_.BarCodeResult,
|
|
78
|
+
BarCodeRegionParameters: recognition_.BarCodeRegionParameters,
|
|
79
|
+
BarCodeExtendedParameters: recognition_.BarCodeExtendedParameters,
|
|
80
|
+
QualitySettings: recognition_.QualitySettings,
|
|
81
|
+
Code128DataPortion: recognition_.Code128DataPortion,
|
|
82
|
+
DataBarExtendedParameters: recognition_.DataBarExtendedParameters,
|
|
83
|
+
DecodeType: recognition_.DecodeType,
|
|
84
|
+
Code128SubType: recognition_.Code128SubType,
|
|
85
|
+
CustomerInformationInterpretingType: recognition_.CustomerInformationInterpretingType,
|
|
86
|
+
BarCodeConfidence: recognition_.BarCodeConfidence,
|
|
87
|
+
License:joint_.License,
|
|
88
|
+
BarcodeException:joint_.BarcodeException,
|
|
89
|
+
Rectangle:joint_.Rectangle,
|
|
90
|
+
Point:joint_.Point,
|
|
91
|
+
BuildVersionInfo:joint_.BuildVersionInfo,
|
|
92
|
+
ComplexBarcodeGenerator : complexbarcode_.ComplexBarcodeGenerator,
|
|
93
|
+
Address : complexbarcode_.Address,
|
|
94
|
+
AddressType : complexbarcode_.AddressType,
|
|
95
|
+
AlternativeScheme : complexbarcode_.AlternativeScheme,
|
|
96
|
+
ComplexCodetextReader : complexbarcode_.ComplexCodetextReader,
|
|
97
|
+
QrBillStandardVersion : complexbarcode_.QrBillStandardVersion,
|
|
98
|
+
SwissQRBill : complexbarcode_.SwissQRBill,
|
|
99
|
+
SwissQRCodetext : complexbarcode_.SwissQRCodetext}
|
|
100
|
+
|