aspose.barcode 25.5.0 → 25.7.0
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/examples/GenerateAndReadExample.js +1 -1
- package/examples/resources/generating/setBarcodeType.png +0 -0
- package/lib/AsposeBarcode.js +1 -1
- package/lib/Generation.js +47 -5
- package/lib/Recognition.js +22 -3
- package/lib/{aspose-barcode-nodejs-25.5.jar → aspose-barcode-nodejs-25.7.jar} +0 -0
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ function generateAndRead()
|
|
|
17
17
|
|
|
18
18
|
reader.readBarCodes().forEach(function(result, i, results)
|
|
19
19
|
{
|
|
20
|
-
console.log("Recognized barcode code text: " + result.getCodeText(
|
|
20
|
+
console.log("Recognized barcode code text: " + result.getCodeText() + "\n");
|
|
21
21
|
console.log("Recognized barcode code type: " + result.getCodeTypeName() + "\n");
|
|
22
22
|
});
|
|
23
23
|
}
|
|
Binary file
|
package/lib/AsposeBarcode.js
CHANGED
|
@@ -4,7 +4,7 @@ const joint_ = require('./Joint');
|
|
|
4
4
|
const complexbarcode_ = require("./ComplexBarcode");
|
|
5
5
|
const generation_ = require("./Generation");
|
|
6
6
|
const recognition_ = require("./Recognition");
|
|
7
|
-
const jar_name_ = "/aspose-barcode-nodejs-25.
|
|
7
|
+
const jar_name_ = "/aspose-barcode-nodejs-25.7.jar";
|
|
8
8
|
const jar_path_ = __dirname + jar_name_;
|
|
9
9
|
const fs = require("fs");
|
|
10
10
|
|
package/lib/Generation.js
CHANGED
|
@@ -127,12 +127,54 @@ class BarcodeGenerator extends joint.BaseJavaClass
|
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* <p>
|
|
130
|
-
*
|
|
131
|
-
* </
|
|
132
|
-
*
|
|
130
|
+
* <p>
|
|
131
|
+
* Encodes the Unicode {@code <b>codeText</b>} into a byte sequence using the specified {@code <b>encoding</b>}.
|
|
132
|
+
* UTF-8 is the most commonly used encoding.
|
|
133
|
+
* If the encoding supports it and {@code <b>insertBOM</b>} is set to {@code true}, the function includes a
|
|
134
|
+
* {@code <a href="https://en.wikipedia.org/wiki/Byte_order_mark#Byte-order_marks_by_encoding">byte order mark (BOM)</a>}.
|
|
135
|
+
* </p>
|
|
136
|
+
* <p>
|
|
137
|
+
* This function is intended for use with 2D barcodes only (e.g., Aztec, QR, DataMatrix, PDF417, MaxiCode, DotCode, HanXin, RectMicroQR, etc.).
|
|
138
|
+
* It enables manual encoding of Unicode text using national or special encodings; however, this method is considered obsolete in modern applications.
|
|
139
|
+
* For modern use cases, {@code <a href="https://en.wikipedia.org/wiki/Extended_Channel_Interpretation">ECI</a>} encoding is recommended for Unicode data.
|
|
140
|
+
* </p>
|
|
141
|
+
* <p>
|
|
142
|
+
* Using this function with 1D barcodes, GS1-compliant barcodes (including 2D), or HIBC barcodes (including 2D) is not supported by the corresponding barcode standards and may lead to unpredictable results.
|
|
143
|
+
* </p>
|
|
144
|
+
* </p><p><hr><blockquote><pre>
|
|
145
|
+
* <p>This example shows how to use {@code SetCodeText} with or without a BOM for 2D barcodes.</p>
|
|
146
|
+
* <pre>
|
|
147
|
+
* //Encode codetext using UTF-8 with BOM
|
|
148
|
+
* let gen = new BarcodeGenerator(EncodeTypes.QR, null);
|
|
149
|
+
* gen.setCodeText("車種名", "UTF-8", true);
|
|
150
|
+
* gen.save("barcode.png", BarCodeImageFormat.PNG);
|
|
151
|
+
*
|
|
152
|
+
* let reader = new BarCodeReader("barcode.png", null, DecodeType.QR);
|
|
153
|
+
* let results = reader.readBarCodes();
|
|
154
|
+
* for(let i = 0; i < results.length; i++)
|
|
155
|
+
* {
|
|
156
|
+
* let result = results[i];
|
|
157
|
+
* console.log("BarCode CodeText: " + result.getCodeText());
|
|
158
|
+
* }
|
|
159
|
+
* //Encode codetext using UTF-8 without BOM
|
|
160
|
+
* let gen = new BarcodeGenerator(EncodeTypes.QR, null);
|
|
161
|
+
* gen.setCodeText("車種名", "UTF-8", false);
|
|
162
|
+
* gen.save("barcode.png", BarCodeImageFormat.PNG);
|
|
163
|
+
* let reader = new BarCodeReader("barcode.png", null, DecodeType.QR);
|
|
164
|
+
* let results = reader.readBarCodes();
|
|
165
|
+
* for(let i = 0; i < results.length; i++)
|
|
166
|
+
* {
|
|
167
|
+
* let result = results[i];
|
|
168
|
+
* console.log("BarCode CodeText: " + result.getCodeText());
|
|
169
|
+
* }
|
|
170
|
+
* </pre>
|
|
171
|
+
* </pre></blockquote></hr></p>
|
|
172
|
+
* @param codeText CodeText string
|
|
133
173
|
* @param encoding Applied encoding
|
|
134
|
-
* @param
|
|
135
|
-
*
|
|
174
|
+
* @param insertBOM
|
|
175
|
+
* Indicates whether to insert a byte order mark (BOM) when the specified encoding supports it (e.g., UTF-8, UTF-16, UTF-32).
|
|
176
|
+
* If set to {@code true}, the BOM is added; if {@code false}, the BOM is omitted even if the encoding normally uses one.
|
|
177
|
+
*
|
|
136
178
|
*/
|
|
137
179
|
setCodeText(codeText, encoding, BoM)
|
|
138
180
|
{
|
package/lib/Recognition.js
CHANGED
|
@@ -1196,11 +1196,30 @@ class BarCodeResult extends joint.BaseJavaClass
|
|
|
1196
1196
|
}
|
|
1197
1197
|
|
|
1198
1198
|
/**
|
|
1199
|
-
*
|
|
1199
|
+
* <p>
|
|
1200
|
+
* Gets the code text with encoding.
|
|
1201
|
+
* </p><p><hr><blockquote><pre>
|
|
1202
|
+
* <p>This example shows how to use {@code getCodeText}:</p>
|
|
1203
|
+
* <pre>
|
|
1204
|
+
* let gen = new BarcodeGenerator(EncodeTypes.DATA_MATRIX, null);
|
|
1205
|
+
* gen.setCodeText("車種名", "932");
|
|
1206
|
+
* gen.save("barcode.png", BarCodeImageFormat.PNG);
|
|
1207
|
+
*
|
|
1208
|
+
* let reader = new BarCodeReader("barcode.png", null, DecodeType.DATA_MATRIX);
|
|
1209
|
+
* let results = reader.readBarCodes();
|
|
1210
|
+
* for(let i = 0; i < results.length; i++)
|
|
1211
|
+
* {
|
|
1212
|
+
* let result = results[i];
|
|
1213
|
+
* console.log("BarCode CodeText: " + result.getCodeText("932"));
|
|
1214
|
+
* }
|
|
1215
|
+
* </pre>
|
|
1216
|
+
* </pre></blockquote></hr></p>
|
|
1217
|
+
* @return A string containing recognized code text.
|
|
1218
|
+
* @param encoding The encoding for codetext.
|
|
1200
1219
|
*/
|
|
1201
|
-
getCodeText()
|
|
1220
|
+
getCodeText(encoding)
|
|
1202
1221
|
{
|
|
1203
|
-
return this.getJavaClass().getCodeTextSync();
|
|
1222
|
+
return this.getJavaClass().getCodeTextSync(encoding);
|
|
1204
1223
|
}
|
|
1205
1224
|
|
|
1206
1225
|
/**
|
|
Binary file
|