aspose.barcode 25.6.0 → 25.8.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.
@@ -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(false) + "\n");
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
  }
@@ -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.6.jar";
7
+ const jar_name_ = "/aspose-barcode-nodejs-25.8.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
- * Encodes codetext with byte order mark (BOM) using specified encoding.
131
- * </p>
132
- * @param codeText CodeText string | Bytes of codetext
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 BoM flag indicates insertion of the Encoding byte order mark (BOM). In case, the Encoding requires byte order mark (BOM) insertion: like UTF8,
135
- * UTF16, UTF32, e.t.c. and flag is set to true, the BOM is added, in case of setting flag to false, the BOM insertion is ignored.
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
  {
@@ -5423,63 +5465,115 @@ class PdfParameters extends joint.BaseJavaClass
5423
5465
  /** no-op initializer */
5424
5466
  init() {}
5425
5467
 
5426
- /** @returns {CMYKColor|null} */
5468
+ /**
5469
+ * CMYK color value of bar code. Null means CMYK color is not used, instead normal RGB color is used.
5470
+ * @returns {CMYKColor|null}
5471
+ */
5427
5472
  getCMYKBarColor()
5428
5473
  {
5429
- return raw == null ? null : CMYKColor.parseCMYK(this.getJavaClass().getCMYKBarColorSync());
5474
+ return CMYKColor.parseCMYK(this.getJavaClass().getCMYKBarColorSync());
5430
5475
  }
5431
5476
 
5432
- /** @param {CMYKColor|null} value */
5477
+ /**
5478
+ * CMYK color value of bar code. Null means CMYK color is not used, instead normal RGB color is used.
5479
+ * @param {CMYKColor|null} value
5480
+ */
5433
5481
  setCMYKBarColor(value)
5434
5482
  {
5435
5483
  this.getJavaClass().setCMYKBarColorSync(value != null ? value.formatCMYK() : null);
5436
5484
  }
5437
5485
 
5438
- /** @returns {CMYKColor|null} */
5486
+ /**
5487
+ * CMYK back color value. Null means CMYK color is not used, instead normal RGB color is used.
5488
+ * @returns {CMYKColor|null}
5489
+ */
5439
5490
  getCMYKBackColor()
5440
5491
  {
5441
- return raw == null ? null : CMYKColor.parseCMYK(this.getJavaClass().getCMYKBackColorSync());
5492
+ return CMYKColor.parseCMYK(this.getJavaClass().getCMYKBackColorSync());
5442
5493
  }
5443
5494
 
5444
- /** @param {CMYKColor|null} value */
5495
+ /**
5496
+ * CMYK back color value. Null means CMYK color is not used, instead normal RGB color is used.
5497
+ * @param {CMYKColor|null} value
5498
+ */
5445
5499
  setCMYKBackColor(value)
5446
5500
  {
5447
5501
  this.getJavaClass().setCMYKBackColorSync(value != null ? value.formatCMYK() : null);
5448
5502
  }
5449
5503
 
5450
- /** @returns {CMYKColor|null} */
5504
+ /**
5505
+ * CMYK color value of Codetext. Null means CMYK color is not used, instead normal RGB color is used.
5506
+ * @returns {CMYKColor|null}
5507
+ */
5451
5508
  getCMYKCodetextColor()
5452
5509
  {
5453
- return raw == null ? null : CMYKColor.parseCMYK(this.getJavaClass().getCMYKCodetextColorSync());
5510
+ return CMYKColor.parseCMYK(this.getJavaClass().getCMYKCodetextColorSync());
5454
5511
  }
5455
5512
 
5456
- /** @param {CMYKColor|null} value */
5513
+ /**
5514
+ * CMYK color value of Codetext. Null means CMYK color is not used, instead normal RGB color is used.
5515
+ * @param {CMYKColor|null} value
5516
+ */
5457
5517
  setCMYKCodetextColor(value)
5458
5518
  {
5459
5519
  this.getJavaClass().setCMYKCodetextColorSync(value != null ? value.formatCMYK() : null);
5460
5520
  }
5461
5521
 
5462
- /** @returns {CMYKColor|null} */
5522
+ /**
5523
+ * CMYK color value of caption above. Null means CMYK color is not used, instead normal RGB color is used.
5524
+ * @returns {CMYKColor|null}
5525
+ */
5463
5526
  getCMYKCaptionAboveColor() {
5464
5527
  return CMYKColor.parseCMYK(this.getJavaClass().getCMYKCaptionAboveColorSync());
5465
5528
  }
5466
5529
 
5467
- /** @param {CMYKColor|null} value */
5530
+ /**
5531
+ * CMYK color value of caption above. Null means CMYK color is not used, instead normal RGB color is used.
5532
+ * @param {CMYKColor|null} value
5533
+ */
5468
5534
  setCMYKCaptionAboveColor(value) {
5469
5535
  this.getJavaClass().setCMYKCaptionAboveColorSync(value != null ? value.formatCMYK() : null);
5470
5536
  }
5471
5537
 
5472
- /** @returns {CMYKColor|null} */
5538
+ /**
5539
+ * CMYK color value of caption below. Null means CMYK color is not used, instead normal RGB color is used.
5540
+ * @returns {CMYKColor|null}
5541
+ */
5473
5542
  getCMYKCaptionBelowColor()
5474
5543
  {
5475
5544
  return CMYKColor.parseCMYK(this.getJavaClass().getCMYKCaptionBelowColorSync());
5476
5545
  }
5477
5546
 
5478
- /** @param {CMYKColor|null} value */
5547
+ /**
5548
+ * CMYK color value of caption below. Null means CMYK color is not used, instead normal RGB color is used.
5549
+ * @param {CMYKColor|null} value
5550
+ */
5479
5551
  setCMYKCaptionBelowColor(value)
5480
5552
  {
5481
5553
  this.getJavaClass().setCMYKCaptionBelowColorSync(value.formatCMYK());
5482
5554
  }
5555
+
5556
+ /**
5557
+ * <p>
5558
+ * Are paths used instead of text (use if Unicode characters are not displayed)
5559
+ * Default value: false.
5560
+ * </p>
5561
+ */
5562
+ isTextAsPath()
5563
+ {
5564
+ return this.getJavaClass().isTextAsPathSync();
5565
+ }
5566
+
5567
+ /**
5568
+ * <p>
5569
+ * Are paths used instead of text (use if Unicode characters are not displayed)
5570
+ * Default value: false.
5571
+ * </p>
5572
+ */
5573
+ setTextAsPath(value)
5574
+ {
5575
+ this.getJavaClass().setTextAsPathSync(value);
5576
+ }
5483
5577
  }
5484
5578
 
5485
5579
  /**
@@ -5525,7 +5619,7 @@ class CMYKColor {
5525
5619
  return v;
5526
5620
  });
5527
5621
 
5528
- return new CMYKColor(nums[0], nums[1], nums[2], nums[3]);
5622
+ return new CMYKColor(nums[0] * 100, nums[1] * 100, nums[2] * 100, nums[3] * 100);
5529
5623
  }
5530
5624
 
5531
5625
  /**
@@ -1196,11 +1196,30 @@ class BarCodeResult extends joint.BaseJavaClass
1196
1196
  }
1197
1197
 
1198
1198
  /**
1199
- * Gets the code text Value: The code text of the barcode
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
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aspose.barcode",
3
- "version": "25.6.0",
3
+ "version": "25.8.0",
4
4
  "description": "barcode generation and recognition component",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"