aspose.barcode 23.3.0 → 23.5.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.
@@ -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-23.3.jar";
7
+ const jar_name_ = "/aspose-barcode-nodejs-23.5.jar";
8
8
  const jar_path_ = __dirname + jar_name_;
9
9
  const fs = require("fs");
10
10
 
package/lib/Generation.js CHANGED
@@ -187,8 +187,6 @@ class BarcodeParameters extends joint.BaseJavaClass
187
187
  {
188
188
  xDimension;
189
189
  barHeight;
190
- barCodeWidth;
191
- barCodeHeight;
192
190
  codeTextParameters;
193
191
  postal;
194
192
  australianPost;
@@ -202,6 +200,7 @@ class BarcodeParameters extends joint.BaseJavaClass
202
200
  pdf417;
203
201
  maxiCode;
204
202
  aztec;
203
+ code128;
205
204
  codabar;
206
205
  coupon;
207
206
  supplement;
@@ -221,8 +220,6 @@ class BarcodeParameters extends joint.BaseJavaClass
221
220
  this.xDimension = new Unit(this.getJavaClass().getXDimensionSync());
222
221
  this.barWidthReduction = new Unit(this.getJavaClass().getBarWidthReductionSync());
223
222
  this.barHeight = new Unit(this.getJavaClass().getBarHeightSync());
224
- this.barCodeWidth = new Unit(this.getJavaClass().getBarCodeWidthSync());
225
- this.barCodeHeight = new Unit(this.getJavaClass().getBarCodeHeightSync());
226
223
  this.codeTextParameters = new CodetextParameters(this.getJavaClass().getCodeTextParametersSync());
227
224
  this.postal = new PostalParameters(this.getJavaClass().getPostalSync());
228
225
  this.australianPost = new AustralianPostParameters(this.getJavaClass().getAustralianPostSync());
@@ -236,6 +233,7 @@ class BarcodeParameters extends joint.BaseJavaClass
236
233
  this.pdf417 = new Pdf417Parameters(this.getJavaClass().getPdf417Sync());
237
234
  this.maxiCode = new MaxiCodeParameters(this.getJavaClass().getMaxiCodeSync());
238
235
  this.aztec = new AztecParameters(this.getJavaClass().getAztecSync());
236
+ this.code128 = new Code128Parameters(this.getJavaClass().getCode128Sync());
239
237
  this.codabar = new CodabarParameters(this.getJavaClass().getCodabarSync());
240
238
  this.coupon = new CouponParameters(this.getJavaClass().getCouponSync());
241
239
  this.supplement = new SupplementParameters(this.getJavaClass().getSupplementSync());
@@ -635,6 +633,16 @@ class BarcodeParameters extends joint.BaseJavaClass
635
633
  return this.aztec;
636
634
  }
637
635
 
636
+ /**
637
+ * <p>
638
+ * Code128 parameters.
639
+ * </p>
640
+ */
641
+ getCode128()
642
+ {
643
+ return this.code128;
644
+ }
645
+
638
646
  /**
639
647
  * Codabar parameters.
640
648
  */
@@ -681,6 +689,26 @@ class BaseGenerationParameters extends joint.BaseJavaClass
681
689
  this.imageHeight = new Unit(this.getJavaClass().getImageHeightSync());
682
690
  }
683
691
 
692
+ /**
693
+ * <p>
694
+ * Gets a value indicating whether is used anti-aliasing mode to render image
695
+ * </p>
696
+ */
697
+ getUseAntiAlias()
698
+ {
699
+ return this.getJavaClass().getUseAntiAliasSync();
700
+ }
701
+
702
+ /**
703
+ * <p>
704
+ * Sets a value indicating whether is used anti-aliasing mode to render image
705
+ * </p>
706
+ */
707
+ setUseAntiAlias(value)
708
+ {
709
+ this.getJavaClass().setUseAntiAliasSync(value);
710
+ }
711
+
684
712
  /**
685
713
  * Background color of the barcode image.<br>
686
714
  * Default value: #FFFFFF<br>
@@ -3903,9 +3931,9 @@ class DotCodeExtCodetextBuilder extends ExtCodetextBuilder
3903
3931
  * </p>
3904
3932
  */
3905
3933
  addFNC3SymbolSeparator()
3906
- {
3907
- this.getJavaClass().addFNC3SymbolSeparatorSync();
3908
- }
3934
+ {
3935
+ this.getJavaClass().addFNC3SymbolSeparatorSync();
3936
+ }
3909
3937
 
3910
3938
  /**
3911
3939
  * <p>
@@ -3943,6 +3971,53 @@ class DotCodeExtCodetextBuilder extends ExtCodetextBuilder
3943
3971
  init() {}
3944
3972
  }
3945
3973
 
3974
+ /**
3975
+ * Code128 parameters.
3976
+ */
3977
+ class Code128Parameters extends joint.BaseJavaClass
3978
+ {
3979
+ init()
3980
+ {
3981
+ // TODO: Implement init() method.
3982
+ }
3983
+
3984
+ constructor(javaClass)
3985
+ {
3986
+ super(javaClass);
3987
+ this.init();
3988
+ }
3989
+
3990
+ /**
3991
+ * <p>
3992
+ * Gets or sets a Code128 encode mode.
3993
+ * Default value: Code128EncodeMode.Auto
3994
+ * </p>
3995
+ */
3996
+ getCode128EncodeMode()
3997
+ {
3998
+ return this.getJavaClass().getCode128EncodeModeSync();
3999
+ }
4000
+ /**
4001
+ * <p>
4002
+ * Gets or sets a Code128 encode mode.
4003
+ * Default value: Code128EncodeMode.Auto
4004
+ * </p>
4005
+ */
4006
+ setCode128EncodeMode(value)
4007
+ {
4008
+ this.getJavaClass().setCode128EncodeModeSync(value);
4009
+ }
4010
+
4011
+ /**
4012
+ * Returns a human-readable string representation of this PatchCodeParameters.
4013
+ * @return string A string that represents this PatchCodeParameters.
4014
+ */
4015
+ toString()
4016
+ {
4017
+ return this.getJavaClass().toStringSync();
4018
+ }
4019
+ }
4020
+
3946
4021
  /**
3947
4022
  * BarcodeClassifications EncodeTypes classification
3948
4023
  * @enum
@@ -5733,9 +5808,28 @@ BarCodeImageFormat =
5733
5808
  SVG: 7
5734
5809
  };
5735
5810
 
5736
- /*
5737
- Specifies the type of 2D component
5738
- @enum
5811
+ /**
5812
+ * Type of 2D component
5813
+ * This sample shows how to create and save a GS1 Composite Bar image.
5814
+ * Note that 1D codetext and 2D codetext are separated by symbol '/'
5815
+ * <code>
5816
+ * let codetext = "(01)03212345678906/(21)A1B2C3D4E5F6G7H8";
5817
+ * let generator = new BarcodeGenerator(EncodeTypes.GS1_COMPOSITE_BAR, codetext))
5818
+ *
5819
+ * generator.getParameters().getBarcode().getGS1CompositeBar().setLinearComponentType(EncodeTypes.GS1_CODE_128);
5820
+ * generator.getParameters().getBarcode().getGS1CompositeBar().setTwoDComponentType(TwoDComponentType.CC_A);
5821
+ *
5822
+ * // Aspect ratio of 2D component
5823
+ * generator.getParameters().getBarcode().getPdf417().setAspectRatio(3);
5824
+ * ///
5825
+ * // X-Dimension of 1D and 2D components
5826
+ * generator.getParameters().getBarcode().getXDimension().setPixels(3);
5827
+ * ///
5828
+ * // Height of 1D component
5829
+ * generator.getParameters().getBarcode().getBarHeight().setPixels(100);
5830
+ * ///
5831
+ * generator.save("test.png", BarcodeImageFormat.PNG);
5832
+ *
5739
5833
  */
5740
5834
  TwoDComponentType =
5741
5835
  {
@@ -6040,6 +6134,80 @@ DotCodeEncodeMode =
6040
6134
  EXTENDED_CODETEXT: 2
6041
6135
  }
6042
6136
 
6137
+
6138
+ /**
6139
+ * <p>
6140
+ * Encoding mode for Code128 barcodes.
6141
+ * {@code Code 128} specification.
6142
+ * </p><p><hr><blockquote><pre>
6143
+ * Thos code demonstrates how to generate code 128 with different encodings
6144
+ * <pre>
6145
+ * [C#]
6146
+ * //Generate code 128 with ISO 15417 encoding
6147
+ *
6148
+ * let generator = new BarcodeGenerator(EncodeTypes.CODE_128, "ABCD1234567890");
6149
+ * generator.getParameters().getBarcode().getCode128().setCode128EncodeMode(Code128EncodeMode.AUTO);
6150
+ * generator.save("d:\\code128Auto.png", BarCodeImageFormat.PNG);
6151
+ *
6152
+ * //Generate code 128 only with Codeset A encoding
6153
+ * let generator = new BarcodeGenerator(EncodeTypes.CODE_128, "ABCD1234567890");
6154
+ * generator.getParameters().getBarcode().getCode128().setCode128EncodeMode(Code128EncodeMode.CODE_A);
6155
+ * generator.save("d:\\code128CodeA.png", BarCodeImageFormat.PNG);
6156
+ * </pre>
6157
+ * </pre></blockquote></hr></p>
6158
+ */
6159
+ Code128EncodeMode =
6160
+ {
6161
+ /**
6162
+ * <p>
6163
+ * Encode codetext in classic ISO 15417 mode. The mode should be used in all ordinary cases.
6164
+ * </p>
6165
+ */
6166
+ AUTO: 0,
6167
+
6168
+ /**
6169
+ * <p>
6170
+ * Encode codetext only in 128A codeset.
6171
+ * </p>
6172
+ */
6173
+ CODE_A: 1,
6174
+
6175
+ /**
6176
+ * <p>
6177
+ * Encode codetext only in 128B codeset.
6178
+ * </p>
6179
+ */
6180
+ CODE_B: 2,
6181
+
6182
+ /**
6183
+ * <p>
6184
+ * Encode codetext only in 128C codeset.
6185
+ * </p>
6186
+ */
6187
+ CODE_C: 4,
6188
+
6189
+ /**
6190
+ * <p>
6191
+ * Encode codetext only in 128A and 128B codesets.
6192
+ * </p>
6193
+ */
6194
+ CODE_AB: 3,
6195
+
6196
+ /**
6197
+ * <p>
6198
+ * Encode codetext only in 128A and 128C codesets.
6199
+ * </p>
6200
+ */
6201
+ CODE_AC: 5,
6202
+
6203
+ /**
6204
+ * <p>
6205
+ * Encode codetext only in 128B and 128C codesets.
6206
+ * </p>
6207
+ */
6208
+ CODE_BC: 6
6209
+ }
6210
+
6043
6211
  module.exports = {
6044
6212
  BarcodeGenerator,
6045
6213
  EncodeTypes,
@@ -6077,6 +6245,7 @@ module.exports = {
6077
6245
  CouponParameters,
6078
6246
  FontUnit,
6079
6247
  QrStructuredAppendParameters,
6248
+ Code128Parameters,
6080
6249
  BarcodeClassifications,
6081
6250
  FontStyle,
6082
6251
  CodabarSymbol,
@@ -6101,5 +6270,6 @@ module.exports = {
6101
6270
  Pdf417MacroTerminator,
6102
6271
  MaxiCodeExtCodetextBuilder,
6103
6272
  DotCodeExtCodetextBuilder,
6104
- DotCodeEncodeMode
6273
+ DotCodeEncodeMode,
6274
+ Code128EncodeMode
6105
6275
  };
@@ -174,154 +174,6 @@ class BarCodeReader extends joint.BaseJavaClass
174
174
  this.getJavaClass().setTimeoutSync(value);
175
175
  }
176
176
 
177
- /**
178
- * Enable checksum validation during recognition for 1D barcodes.<br>
179
- * Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.<br>
180
- * Checksum never used: Codabar<br>
181
- * Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, <br>
182
- * Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN<br>
183
- * Checksum always used: Rest symbologies<br>
184
- * <pre><code>
185
- * //This sample shows influence of ChecksumValidation on recognition quality and results
186
- *
187
- * let generator = new BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128");
188
- * generator.save("test.png");
189
- * let reader = new BarCodeReader("test.png", null, DecodeType.EAN_13);
190
- * //checksum disabled
191
- * reader.setChecksumValidation(ChecksumValidation.OFF);
192
- * reader.readBarCodes().forEach(function(result, i, results)
193
- * {
194
- * console.log("BarCode CodeText: " + result.getCodeText());
195
- * console.log("BarCode Value: " + result.getExtended().getOneD().getValue());
196
- * console.log("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
197
- * });
198
- * let reader = new BarCodeReader("test.png", null, DecodeType.EAN_13);
199
- * //checksum enabled
200
- * reader.setChecksumValidation(ChecksumValidation.ON);
201
- * reader.readBarCodes().forEach(function(result, i, results)
202
- * {
203
- * console.log("BarCode CodeText: " + result.getCodeText());
204
- * console.log("BarCode Value: " + result.getExtended().getOneD().getValue());
205
- * console.log("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
206
- * });
207
- * </code></pre>
208
- *
209
- * The checksum validation flag.
210
- */
211
- getChecksumValidation()
212
- {
213
- return this.getJavaClass().getChecksumValidationSync();
214
- }
215
-
216
- /**
217
- *
218
- * Enable checksum validation during recognition for 1D barcodes.<br>
219
- * Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.<br>
220
- * Checksum never used: Codabar<br>
221
- * Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN<br>
222
- * Checksum always used: Rest symbologies<br>
223
- *@example
224
- * This sample shows influence of ChecksumValidation on recognition quality and results
225
- *
226
- * let generator = new BarcodeGenerator(EncodeTypes.EAN_13, "1234567890128");
227
- * generator.save("test.png");
228
- * let reader = new BarCodeReader("test.png", null, DecodeType.EAN_13);
229
- * //checksum disabled
230
- * reader.setChecksumValidation(ChecksumValidation.OFF);
231
- * reader.readBarCodes().forEach(function(result, i, results)
232
- * {
233
- * console.log("BarCode CodeText: " + result.getCodeText());
234
- * console.log("BarCode Value: " + result.getExtended().getOneD().getValue());
235
- * console.log("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
236
- * });
237
- * let reader = new BarCodeReader("test.png", null, DecodeType.EAN_13);
238
- * //checksum enabled
239
- * reader.setChecksumValidation(ChecksumValidation.ON);
240
- * reader.readBarCodes().forEach(function(result, i, results)
241
- * {
242
- * console.log("BarCode CodeText: " + result.getCodeText());
243
- * console.log("BarCode Value: " + result.getExtended().getOneD().getValue());
244
- * console.log("BarCode Checksum: " + result.getExtended().getOneD().getCheckSum());
245
- * });
246
- *
247
- * The checksum validation flag.
248
- */
249
- setChecksumValidation(value)
250
- {
251
- this.getJavaClass().setChecksumValidationSync(value);
252
- }
253
-
254
- /**
255
- * Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
256
- *@example
257
- * //This sample shows how to strip FNC characters<br>
258
- *
259
- * let generator = new BarcodeGenerator(EncodeTypes.GS1Code128, "(02)04006664241007(37)1(400)7019590754");
260
- * generator.save("test.png");
261
- * let reader = new BarCodeReader("test.png", null, DecodeType.CODE_128);
262
- * //StripFNC disabled
263
- * reader.setStripFNC(false);
264
- * reader.readBarCodes().forEach(function(result, i, results)
265
- * {
266
- * console.log("BarCode CodeText: " + result.getCodeText());
267
- * });
268
- * let reader = new BarCodeReader("test.png", null, DecodeType.CODE_128);
269
- * //StripFNC enabled
270
- * reader.setStripFNC(true);
271
- * reader.readBarCodes().forEach(function(result, i, results)
272
- * {
273
- * console.log("BarCode CodeText: " + result.getCodeText());
274
- * });
275
- */
276
- getStripFNC()
277
- {
278
- return this.getJavaClass().getStripFNCSync();
279
- }
280
-
281
- /**
282
- * Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
283
- *@example
284
- * //This sample shows how to strip FNC characters
285
- *
286
- * let generator = new BarcodeGenerator(EncodeTypes.GS1Code128, "(02)04006664241007(37)1(400)7019590754");
287
- * generator.save("test.png");
288
- * let reader = new BarCodeReader("test.png", null, DecodeType.CODE_128);
289
- * //StripFNC disabled
290
- * reader.setStripFNC(false);
291
- * reader.readBarCodes().forEach(function(result, i, results)
292
- * {
293
- * console.log("BarCode CodeText: " + result.getCodeText());
294
- * });
295
- * let reader = new BarCodeReader("test.png", null, DecodeType.CODE_128);
296
- * //StripFNC enabled
297
- * reader.setStripFNC(true);
298
- * reader.readBarCodes().forEach(function(result, i, results)
299
- * {
300
- * console.log("BarCode CodeText: " + result.getCodeText());
301
- * });
302
- *
303
- */
304
- setStripFNC(value)
305
- {
306
- this.getJavaClass().setStripFNCSync(value);
307
- }
308
-
309
- /**
310
- * Gets the Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.OTHER.
311
- */
312
- getCustomerInformationInterpretingType()
313
- {
314
- return this.getJavaClass().getCustomerInformationInterpretingTypeSync();
315
- }
316
-
317
- /**
318
- * Sets the Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.OTHER.
319
- */
320
- setCustomerInformationInterpretingType(value)
321
- {
322
- this.getJavaClass().setCustomerInformationInterpretingTypeSync(value);
323
- }
324
-
325
177
  abort()
326
178
  {
327
179
  this.getJavaClass().abortSync();
@@ -481,62 +333,6 @@ class BarCodeReader extends joint.BaseJavaClass
481
333
  return this.barcodeSettings;
482
334
  }
483
335
 
484
- /**
485
- * A flag which force engine to detect codetext encoding for Unicode codesets.
486
- * @example
487
- * // This sample shows how to detect text encoding on the fly if DetectEncoding is enabled
488
- * image = "image.png";
489
- * let generator = new BarcodeGenerator(EncodeTypes.QR, "пїЅпїЅпїЅпїЅпїЅ"))
490
- * generator.getParameters().getBarcode().getQR().setCodeTextEncoding("UTF-8");
491
- * generator.save(image, BarCodeImageFormat.getPng());
492
- * //detects encoding for Unicode codesets is enabled
493
- * let reader = new BarCodeReader(image, null, DecodeType.QR);
494
- * reader.setDetectEncoding(true);
495
- * reader.readBarCodes().forEach(function(result, i, results)
496
- * {
497
- * console.log("BarCode CodeText: " + result.getCodeText());
498
- * });
499
- * //detect encoding is disabled
500
- * let reader = new BarCodeReader(image, null, DecodeType.QR);
501
- * reader.setDetectEncoding(false);
502
- * reader.readBarCodes().forEach(function(result, i, results)
503
- * {
504
- * console.log("BarCode CodeText: " + result.getCodeText());
505
- * });
506
- */
507
- getDetectEncoding()
508
- {
509
- return this.getJavaClass().getDetectEncodingSync();
510
- }
511
-
512
- /**
513
- * A flag which force engine to detect codetext encoding for Unicode codesets.
514
- * @example
515
- * //This sample shows how to detect text encoding on the fly if DetectEncoding is enabled
516
- * let image = "image.png";
517
- * let generator = new BarcodeGenerator(EncodeTypes.QR, "пїЅпїЅпїЅпїЅпїЅ");
518
- * generator.getParameters().getBarcode().getQR().setCodeTextEncoding("UTF-8");
519
- * generator.save(image, BarCodeImageFormat.getPng());
520
- * //detects encoding for Unicode codesets is enabled
521
- * let reader = new BarCodeReader(image, null, DecodeType.QR);
522
- * reader.setDetectEncoding(true);
523
- * reader.readBarCodes().forEach(function(result, i, results)
524
- * {
525
- * console.log("BarCode CodeText: " + result.getCodeText());
526
- * });
527
- * //detect encoding is disabled
528
- * let reader = new BarCodeReader(image, null, DecodeType.QR);
529
- * reader.setDetectEncoding(true);
530
- * reader.readBarCodes().forEach(function(result, i, results)
531
- * {
532
- * console.log("BarCode CodeText: " + result.getCodeText());
533
- * });
534
- */
535
- setDetectEncoding(value)
536
- {
537
- this.getJavaClass().setDetectEncodingSync(value);
538
- }
539
-
540
336
  /**
541
337
  * Sets bitmap image and areas for recognition.
542
338
  * Must be called before ReadBarCodes() method.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aspose.barcode",
3
- "version": "23.3.0",
3
+ "version": "23.5.0",
4
4
  "description": "barcode generation and recognition component",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"