const fs = require("fs");
const java = require('java');
const joint = require("./Joint");
/**
* BarcodeGenerator for backend barcode images generation.
* supported symbologies:
* 1D:
* Codabar, Code11, Code128, Code39Standard, Code39Extended
* Code93Standard, Code93Extended, EAN13, EAN8, Interleaved2of5,
* MSI, Standard2of5, UPCA, UPCE, ISBN, GS1Code128, Postnet, Planet
* EAN14, SCC14, SSCC18, ITF14, SingaporePost ...
* 2D:
* Aztec, DataMatrix, PDf417, QR code ...
* @example
* // This sample shows how to create and save a barcode image.
* let encode_type = EncodeTypes.CODE_128;
* let generator = new BarcodeGenerator(encode_type);
* generator.setCodeText("123ABC");
*/
class BarcodeGenerator extends joint.BaseJavaClass
{
parameters;
static get javaClassName()
{
return "com.aspose.mw.barcode.generation.MwBarcodeGenerator";
}
/**
* BarcodeGenerator constructor.
* @param encodeType Barcode symbology type. Use EncodeTypes class to setup a symbology
* @param codeText Text to be encoded.
* @code
* let barcodeGenerator = new BarcodeGenerator(EncodeTypes.EAN_14, "332211");
* @encode
* @throws BarcodeException
*/
constructor(encodeType, codeText)
{
let java_class_link = java.import(BarcodeGenerator.javaClassName);
let java_class = new java_class_link(encodeType, codeText);
super(java_class);
this.init();
}
static construct(javaClass)
{
let barcodeGenerator = new BarcodeGenerator(0, "");
barcodeGenerator.setJavaClass(javaClass);
return barcodeGenerator;
}
init()
{
this.parameters = new BaseGenerationParameters(this.getJavaClass().getParametersSync());
}
/**
* Generation parameters.
* @return BaseGenerationParameters
*/
getParameters()
{
return this.parameters;
}
/**
* Barcode symbology type.
*/
getBarcodeType()
{
return this.getJavaClass().getBarcodeTypeSync();
}
/**
* Barcode symbology type.
*/
setBarcodeType(value)
{
this.getJavaClass().setBarcodeTypeSync(value);
}
/**
* Generate the barcode image under current settings.
* This sample shows how to create and save a barcode image.
* @param {BarCodeImageFormat} format BarCodeImageFormat value (PNG, BMP, JPEG, GIF)
* @example
* let generator = new BarCodeGenerator(EncodeTypes.CODE_128);
* let image = generator.generateBarCodeImage(BarCodeImageFormat.GIF);
* @return {String} base64 representation of image.
*/
generateBarCodeImage(format)
{
try {
let base64Image = this.getJavaClass().generateBarCodeImageSync(format);
return (base64Image);
} catch (e) {
throw new joint.BarcodeException(e)
}
}
/**
* Save barcode image to specific file in specific format.
* @param {String} filePath Path to save to.
* @param {BarCodeImageFormat} format BarCodeImageFormat value (PNG, BMP, JPEG, GIF)
* @example
* let generator = new BarCodeGenerator(EncodeTypes.CODE_128);
* generator.save("file path", BarCodeImageFormat.GIF);
*/
save(filePath, format)
{
let image64 = this.generateBarCodeImage(format);
let buff = Buffer.from(image64, 'base64');
fs.writeFileSync(filePath, buff);
}
/**
* Text to be encoded.
*/
getCodeText()
{
return this.getJavaClass().getCodeTextSync();
}
/**
* <p>
* Encodes codetext with byte order mark (BOM) using specified encoding.
* </p>
* @param codeText CodeText string | Bytes of codetext
* @param encoding Applied encoding
*/
setCodeText(codeText, encoding)
{
if (Array.isArray(codeText)) {
this.getJavaClass().setCodeBytesSync(Buffer.from(codeText));
}
else {
this.getJavaClass().setCodeTextSync(codeText, encoding);
}
}
/**
* Exports BarCode properties to the xml file specified
* @param filePath The xml file
* @return Whether or not export completed successfully. Returns <b>True</b> in case of success; <b>False</b> Otherwise </para>
* @throws IOException
*/
exportToXml(filePath)
{
try {
let xmlData = this.getJavaClass().exportToXmlSync();
let isSaved = xmlData != null;
if (isSaved) {
fs.writeFileSync(filePath, Buffer.from(xmlData, 'base64').toString('utf-8'));
}
return isSaved;
} catch (ex) {
throw new joint.BarcodeException(ex.getMessage());
}
}
/**
* <p>
* Imports BarCode properties from the xml-file specified and creates BarcodeGenerator instance.
* </p>
* @return BarcodeGenerator instance
* @param filePath The name of the file
*/
static importFromXml(filePath)
{
try {
let xmlData = joint.convertImageResourceToBase64(filePath);
// let offset = 6;
// xmlData = xmlData.substr(offset);
let java_class_link = java.import(BarcodeGenerator.javaClassName);
return BarcodeGenerator.construct(java_class_link.importFromXmlSync(xmlData));
} catch (ex) {
throw new joint.BarcodeException(ex.toString());
}
}
}
/**
* Barcode generation parameters.
*/
class BarcodeParameters extends joint.BaseJavaClass
{
xDimension;
barHeight;
codeTextParameters;
postal;
australianPost;
codablock;
dataBar;
gs1CompositeBar;
dataMatrix;
code16K;
itf;
qr;
pdf417;
maxiCode;
aztec;
code128;
codabar;
coupon;
hanXin;
supplement;
dotCode;
padding;
patchCode;
barWidthReduction;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this.xDimension = new Unit(this.getJavaClass().getXDimensionSync());
this.barWidthReduction = new Unit(this.getJavaClass().getBarWidthReductionSync());
this.barHeight = new Unit(this.getJavaClass().getBarHeightSync());
this.codeTextParameters = new CodetextParameters(this.getJavaClass().getCodeTextParametersSync());
this.postal = new PostalParameters(this.getJavaClass().getPostalSync());
this.australianPost = new AustralianPostParameters(this.getJavaClass().getAustralianPostSync());
this.codablock = new CodablockParameters(this.getJavaClass().getCodablockSync());
this.dataBar = new DataBarParameters(this.getJavaClass().getDataBarSync());
this.gs1CompositeBar = new GS1CompositeBarParameters(this.getJavaClass().getGS1CompositeBarSync());
this.dataMatrix = new DataMatrixParameters(this.getJavaClass().getDataMatrixSync());
this.code16K = new Code16KParameters(this.getJavaClass().getCode16KSync());
this.itf = new ITFParameters(this.getJavaClass().getITFSync());
this.qr = new QrParameters(this.getJavaClass().getQRSync());
this.pdf417 = new Pdf417Parameters(this.getJavaClass().getPdf417Sync());
this.maxiCode = new MaxiCodeParameters(this.getJavaClass().getMaxiCodeSync());
this.aztec = new AztecParameters(this.getJavaClass().getAztecSync());
this.code128 = new Code128Parameters(this.getJavaClass().getCode128Sync());
this.codabar = new CodabarParameters(this.getJavaClass().getCodabarSync());
this.coupon = new CouponParameters(this.getJavaClass().getCouponSync());
this.hanXin = new HanXinParameters(this.getJavaClass().getHanXinSync());
this.supplement = new SupplementParameters(this.getJavaClass().getSupplementSync());
this.dotCode = new DotCodeParameters(this.getJavaClass().getDotCodeSync());
this.padding = new Padding(this.getJavaClass().getPaddingSync());
this.patchCode = new PatchCodeParameters(this.getJavaClass().getPatchCodeSync());
}
/**
* x-dimension is the smallest width of the unit of BarCode bars or spaces.<br>
* Increase this will increase the whole barcode image width.<br>
* Ignored if AutoSizeMode property is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.
*/
getXDimension()
{
return this.xDimension;
}
/**
* x-dimension is the smallest width of the unit of BarCode bars or spaces.<br>
* Increase this will increase the whole barcode image width.<br>
* Ignored if AutoSizeMode property is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.
* @throws BarcodeException
*/
setXDimension(value)
{
this.getJavaClass().setXDimensionSync(value.getJavaClass());
this.xDimension = value;
}
/**
* Height of 1D barcodes' bars in Unit value.<br>
* Ignored if AutoSizeMode property is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.
* @throws BarcodeException
*/
getBarHeight()
{
return this.barHeight;
}
/**
* Height of 1D barcodes' bars in Unit value.<br>
* Ignored if AutoSizeMode property is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.
* @throws BarcodeException
*/
setBarHeight(value)
{
this.getJavaClass().setBarHeightSync(value.getJavaClass());
this.barHeight = value;
}
/**
* Bars color.
* @return value of Bar color
* Default value: #000000
*/
getBarColor()
{
let intColor = this.getJavaClass().getBarColorSync();
let hexColor = ((intColor) >>> 0).toString(16).slice(-6).toUpperCase()
while (hexColor.length < 6) {
hexColor = "0" + hexColor;
}
hexColor = "#" + hexColor;
return hexColor;
}
/**
* Bars color.
* @param {String} value for Bar color
* Default value: #000000.
*/
setBarColor(value)
{
this.getJavaClass().setBarColorSync((parseInt(value.substr(1), 16) << 8) / 256);
}
/**
* Barcode paddings.<br>
* Default value: 5pt 5pt 5pt 5pt.
*/
getPadding()
{
return this.padding;
}
/**
* Barcode paddings.<br>
* Default value: 5pt 5pt 5pt 5pt.
*/
setPadding(value)
{
this.getJavaClass().setPaddingSync(value.getJavaClass());
this.padding = value;
}
/**
* Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.
*/
getChecksumAlwaysShow()
{
return this.getJavaClass().getChecksumAlwaysShowSync();
}
/**
* Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.
*/
setChecksumAlwaysShow(value)
{
this.getJavaClass().setChecksumAlwaysShowSync(value);
}
/**
* Enable checksum during generation 1D barcodes.<br>
* Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible.<br>
* Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar<br>
* Checksum always used: Rest symbology
*/
isChecksumEnabled()
{
return this.getJavaClass().isChecksumEnabledSync();
}
/**
* Enable checksum during generation 1D barcodes.<br>
* Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible.<br>
* Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar<br>
* Checksum always used: Rest symbology
*/
setChecksumEnabled(value)
{
this.getJavaClass().setChecksumEnabledSync(value);
}
/**
* Indicates whether explains the character "\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only<br>
* If the EnableEscape is true, "\" will be explained as a special escape character. Otherwise, "\" acts as normal characters.<br>
* Aspose.BarCode supports inputing decimal ascii code and mnemonic for ASCII control-code characters. For example, \013 and \\CR stands for CR.
*/
getEnableEscape()
{
return this.getJavaClass().getEnableEscapeSync();
}
/**
* Indicates whether explains the character "\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only<br>
* If the EnableEscape is true, "\" will be explained as a special escape character. Otherwise, "\" acts as normal characters.<br>
*<hr>Aspose.BarCode supports the decimal ascii code and mnemonic for ASCII control-code characters. For example, \013 and \\CR stands for CR.</hr>
*/
setEnableEscape(value)
{
this.getJavaClass().setEnableEscapeSync(value);
}
/**
* Wide bars to Narrow bars ratio<br>.
* Default value: 3, that is, wide bars are 3 times as wide as narrow bars<br>.
* Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard<br>
*
* The WideNarrowRatio parameter value is less than or equal to 0.
*/
getWideNarrowRatio()
{
return this.getJavaClass().getWideNarrowRatioSync();
}
/**
* Wide bars to Narrow bars ratio.<br>
* Default value: 3, that is, wide bars are 3 times as wide as narrow bars.<br>
* Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, <br>
* VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard<br>
* <br>
* The WideNarrowRatio parameter value is less than or equal to 0.
*/
setWideNarrowRatio(value)
{
this.getJavaClass().setWideNarrowRatioSync(value);
}
/**
* Codetext parameters.
*/
getCodeTextParameters()
{
return this.codeTextParameters;
}
/**
* Gets a value indicating whether bars filled.<br>
* Only for 1D barcodes.<br>
* Default value: true.
*/
getFilledBars()
{
return this.getJavaClass().getFilledBarsSync();
}
/**
* Sets a value indicating whether bars filled.<br>
* Only for 1D barcodes.<br>
* Default value: true.
*/
setFilledBars(value)
{
this.getJavaClass().setFilledBarsSync(value);
}
/**
* Get bars reduction value that is used to compensate ink spread while printing.<br>
* @return Unit value of BarWidthReduction
*/
getBarWidthReduction()
{
return this.barWidthReduction;
}
/**
* Sets bars reduction value that is used to compensate ink spread while printing.
*/
setBarWidthReduction(value)
{
this.getJavaClass().setBarWidthReductionSync(value.getJavaClass());
this.barWidthReduction = value;
}
/**
* Postal parameters. Used for Postnet, Planet.
*/
getPostal()
{
return this.postal;
}
/**
* PatchCode parameters.
*/
getPatchCode()
{
return this.patchCode;
}
/**
* AustralianPost barcode parameters.
*/
getAustralianPost()
{
return this.australianPost;
}
/**
* Databar parameters.
*/
getDataBar()
{
return this.dataBar;
}
/**
* GS1 Composite Bar parameters.<br>
* <br>
* This sample shows how to create and save a GS1 Composite Bar image.<br>
* Note that 1D codetext and 2D codetext are separated by symbol '/'
*
* @example
* let codetext = "(01)03212345678906/(21)A1B2C3D4E5F6G7H8";
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_COMPOSITE_BAR, codetext);
*
* generator.getParameters().getBarcode().getGS1CompositeBar().setLinearComponentType(EncodeTypes.GS_1_CODE_128);
* generator.getParameters().getBarcode().getGS1CompositeBar().setTwoDComponentType(TwoDComponentType.CC_A);
*
* // Aspect ratio of 2D component
* generator.getParameters().getBarcode().getPdf417().setAspectRatio(3);
*
* // X-Dimension of 1D and 2D components
* generator.getParameters().getBarcode().getXDimension().setPixels(3);
* ///
* // Height of 1D component
* generator.getParameters().getBarcode().getBarHeight().setPixels(100);
* ///
* generator.save("test.png", BarcodeImageFormat.PNG);
*
* @return GS1CompositeBarParameters GS1 Composite Bar parameters.
*/
getGS1CompositeBar()
{
return this.gs1CompositeBar;
}
/**
* GS1 Composite Bar parameters.<br>
* <br>
* This sample shows how to create and save a GS1 Composite Bar image.<br>
* Note that 1D codetext and 2D codetext are separated by symbol '/'
*
* @example
* let codetext = "(01)03212345678906/(21)A1B2C3D4E5F6G7H8";
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_COMPOSITE_BAR, codetext);
*
* generator.getParameters().getBarcode().getGS1CompositeBar().setLinearComponentType(EncodeTypes.GS_1_CODE_128);
* generator.getParameters().getBarcode().getGS1CompositeBar().setTwoDComponentType(TwoDComponentType.CC_A);
*
* // Aspect ratio of 2D component
* generator.getParameters().getBarcode().getPdf417().setAspectRatio(3);
*
* // X-Dimension of 1D and 2D components
* generator.getParameters().getBarcode().getXDimension().setPixels(3);
*
* // Height of 1D component
* generator.getParameters().getBarcode().getBarHeight().setPixels(100);
*
* generator.save("test.png", BarcodeImageFormat.PNG);
*/
setGS1CompositeBar(value)
{
this.gs1CompositeBar = value;
this.getJavaClass().setGS1CompositeBarSync(value.getJavaClass());
}
/**
* Codablock parameters.
*/
getCodablock()
{
return this.codablock;
}
/**
* DataMatrix parameters.
*/
getDataMatrix()
{
return this.dataMatrix;
}
/**
* Code16K parameters.
*/
getCode16K()
{
return this.code16K;
}
/**
* DotCode parameters.
*/
getDotCode()
{
return this.dotCode;
}
/**
* ITF parameters.
*/
getITF()
{
return this.itf;
}
/**
* PDF417 parameters.
*/
getPdf417()
{
return this.pdf417;
}
/**
* QR parameters.
*/
getQR()
{
return this.qr;
}
/**
* Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN.
*/
getSupplement()
{
return this.supplement;
}
/**
* MaxiCode parameters.
*/
getMaxiCode()
{
return this.maxiCode;
}
/**
* Aztec parameters.
*/
getAztec()
{
return this.aztec;
}
/**
* <p>
* Code128 parameters.
* </p>
*/
getCode128()
{
return this.code128;
}
/**
* Codabar parameters.
*/
getCodabar()
{
return this.codabar;
}
/**
* Coupon parameters. Used for UpcaGs1DatabarCoupon, UpcaGs1Code128Coupon.
*/
getCoupon()
{
return this.coupon;
}
/**
* HanXin parameters.
*/
getHanXin()
{
return this.hanXin;
}
}
/**
* Barcode image generation parameters.
*/
class BaseGenerationParameters extends joint.BaseJavaClass
{
captionAbove;
captionBelow;
barcodeParameters;
borderParameters;
image;
imageWidth;
imageHeight;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this.captionAbove = new CaptionParameters(this.getJavaClass().getCaptionAboveSync());
this.captionBelow = new CaptionParameters(this.getJavaClass().getCaptionBelowSync());
this.barcodeParameters = new BarcodeParameters(this.getJavaClass().getBarcodeSync());
this.borderParameters = new BorderParameters(this.getJavaClass().getBorderSync());
this.imageWidth = new Unit(this.getJavaClass().getImageWidthSync());
this.imageHeight = new Unit(this.getJavaClass().getImageHeightSync());
this.image = new ImageParameters(this.getJavaClass().getImageSync());
}
/**
* Gets a value indicating whether is used anti-aliasing mode to render image
*/
getUseAntiAlias()
{
return this.getJavaClass().getUseAntiAliasSync();
}
/**
* Sets a value indicating whether is used anti-aliasing mode to render image
*/
setUseAntiAlias(value)
{
this.getJavaClass().setUseAntiAliasSync(value);
}
/**
* Background color of the barcode image.<br>
* Default value: #FFFFFF<br>
*/
getBackColor()
{
let intColor = this.getJavaClass().getBackColorSync();
let hexColor = ((intColor) >>> 0).toString(16).slice(-6).toUpperCase()
while (hexColor.length < 6) {
hexColor = "0" + hexColor;
}
hexColor = "#" + hexColor;
return hexColor;
}
/**
* Background color of the barcode image.<br>
* Default value: #FFFFFF<br>
*/
setBackColor(colorValue)
{
let hexValue = colorValue.substring(1, colorValue.length)
if (!(/^[0-9A-Fa-f]+$/.test(hexValue))) {
throw new joint.BarcodeException("Illegal color value: " + hexValue);
}
this.getJavaClass().setBackColorSync((parseInt(hexValue, 16) << 8) / 256);
}
/**
* <p>
* Gets the resolution of the BarCode image.<br>
* One value for both dimensions.<br>
* Default value: 96 dpi.<br>
* </p>
* The Resolution parameter value is less than or equal to 0.
*/
getResolution()
{
return this.getJavaClass().getResolutionSync();
}
/**
* <p>
* Sets the resolution of the BarCode image.<br>
* One value for both dimensions.<br>
* Default value: 96 dpi.<br>
* </p>
*
* The Resolution parameter value is less than or equal to 0.
*/
setResolution(value)
{
this.getJavaClass().setResolutionSync(java.newFloat(value));
}
/**
* Image parameters. See ImageParameters.
* @return ImageParameters
*/
getImage()
{
return this.image;
}
/**
* BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation.<br>
* If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image<br>.
* Default value: 0.<br>
* @example
* //This sample shows how to create and save a BarCode image.
* let generator = new BarcodeGenerator( EncodeTypes.DATA_MATRIX);
* generator.getParameters().setRotationAngle(7);
* generator.save("test.png", BarcodeImageFormat.PNG);
*/
getRotationAngle()
{
return this.getJavaClass().getRotationAngleSync();
}
/**
* BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation.<br>
* If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image.<br>
* Default value: 0.<br>
* @example
* //This sample shows how to create and save a BarCode image.
* let generator = new BarcodeGenerator( EncodeTypes.DATA_MATRIX);
* generator.getParameters().setRotationAngle(7);
* generator.save("test.png", BarcodeImageFormat.PNG);
*/
setRotationAngle(value)
{
this.getJavaClass().setRotationAngleSync(java.newFloat(value));
}
/**
* Caption Above the BarCode image. See CaptionParameters.
*/
getCaptionAbove()
{
return this.captionAbove;
}
/**
* Caption Above the BarCode image. See CaptionParameters.
*/
setCaptionAbove(value)
{
this.getJavaClass().setCaptionAboveSync(value.getJavaClass());
this.captionAbove.updateCaption(value);
}
/**
* Caption Below the BarCode image. See CaptionParameters.
*/
getCaptionBelow()
{
return this.captionBelow;
}
/**
* Caption Below the BarCode image. See CaptionParameters.
*/
setCaptionBelow(value)
{
this.getJavaClass().setCaptionBelowSync(value.getJavaClass());
this.captionBelow.updateCaption(value);
}
/**
* Specifies the different types of automatic sizing modes.<br>
* Default value: AutoSizeMode.NONE.
*/
getAutoSizeMode()
{
return this.getJavaClass().getAutoSizeModeSync();
}
/**
* Specifies the different types of automatic sizing modes.<br>
* Default value: AutoSizeMode.NONE.
*/
setAutoSizeMode(value)
{
this.getJavaClass().setAutoSizeModeSync(value);
}
/**
* BarCode image height when AutoSizeMode property is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.
*/
getImageHeight()
{
return this.imageHeight;
}
/**
* BarCode image height when AutoSizeMode property is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.
*/
setImageHeight(value)
{
this.getJavaClass().setImageHeight(value.getJavaClass());
this.imageHeight = value;
}
/**
* BarCode image width when AutoSizeMode property is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.
*/
getImageWidth()
{
return this.imageWidth;
}
/**
* BarCode image width when AutoSizeMode property is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.
*/
setImageWidth(value)
{
this.getJavaClass().setImageWidth(value.getJavaClass());
this.imageWidth = value;
}
/**
* Gets the BarcodeParameters that contains all barcode properties.
*/
getBarcode()
{
return this.barcodeParameters;
}
/**
* Gets the BorderParameters that contains all configuration properties for barcode border.
*/
getBorder()
{
return this.borderParameters;
}
}
/**
* Barcode image border parameters
*/
class BorderParameters extends joint.BaseJavaClass
{
width;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this.width = new Unit(this.getJavaClass().getWidthSync());
}
/**
* Border visibility. If false than parameter Width is always ignored (0).<br>
* Default value: false.
*/
getVisible()
{
return this.getJavaClass().getVisibleSync();
}
/**
* Border visibility. If false than parameter Width is always ignored (0).<br>
* Default value: false.
*/
setVisible(value)
{
this.getJavaClass().setVisibleSync(value);
}
/**
* Border width.<br>
* Default value: 0.<br>
* Ignored if Visible is set to false.
*/
getWidth()
{
return this.width;
}
/**
* Border width.<br>
* Default value: 0.<br>
* Ignored if Visible is set to false.
*/
setWidth(value)
{
this.getJavaClass().setWidthSync(value.getJavaClass());
this.width = value;
}
/**
* Returns a human-readable string representation of this BorderParameters.<br>
* @return A string that represents this BorderParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
/**
* Border dash style.<br>
* Default value: BorderDashStyle.SOLID.
*/
getDashStyle()
{
return this.getJavaClass().getDashStyleSync();
}
/**
* Border dash style.<br>
* Default value: BorderDashStyle.SOLID.
*/
setDashStyle(value)
{
this.getJavaClass().setDashStyleSync(value);
}
/**
* Border color.<br>
* Default value: #000000
*/
getColor()
{
let intColor = this.getJavaClass().getColorSync();
let hexColor = ((intColor) >>> 0).toString(16).slice(-6).toUpperCase()
while (hexColor.length < 6) {
hexColor = "0" + hexColor;
}
hexColor = "#" + hexColor;
return hexColor;
}
/**
* Border color.<br>
* Default value: #000000
*/
setColor(hexValue)
{
this.getJavaClass().setColorSync((parseInt(hexValue.substr(1), 16) << 8) / 256);
}
}
/**
* Caption parameters.
*/
class CaptionParameters extends joint.BaseJavaClass
{
font;
padding;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this.padding = new Padding(this.getJavaClass().getPaddingSync());
this.font = new FontUnit(this.getJavaClass().getFontSync());
}
/**
* Caption text.<br>
* Default value: empty string.
*/
getText()
{
return this.getJavaClass().getTextSync();
}
/**
* Caption text.<br>
* Default value: empty string.
*/
setText(value)
{
this.getJavaClass().setTextSync(value);
}
/**
* Caption font.<br>
* Default value: Arial 8pt regular.
*/
getFont()
{
return this.font;
}
/**
* Caption text visibility.<br>
* Default value: false.
*/
getVisible()
{
return this.getJavaClass().getVisibleSync();
}
/**
* Caption text visibility.<br>
* Default value: false.
*/
setVisible(value)
{
this.getJavaClass().setVisibleSync(value);
}
/**
* Caption text color.<br>
* Default value BLACK.
*/
getTextColor()
{
let intColor = this.getJavaClass().getTextColorSync();
let hexColor = ((intColor) >>> 0).toString(16).slice(-6).toUpperCase()
while (hexColor.length < 6) {
hexColor = "0" + hexColor;
}
hexColor = "#" + hexColor;
return hexColor;
}
/**
* Caption text color.<br>
* Default value BLACK.
*/
setTextColor(hexValue)
{
this.getJavaClass().setTextColorSync((parseInt(hexValue.substr(1), 16) << 8) / 256);
}
/**
* Captions paddings.<br>
* Default value for CaptionAbove: 5pt 5pt 0 5pt.<br>
* Default value for CaptionBelow: 0 5pt 5pt 5pt.
*/
getPadding()
{
return this.padding;
}
/**
* Captions paddings.<br>
* Default value for CaptionAbove: 5pt 5pt 0 5pt.<br>
* Default value for CaptionBelow: 0 5pt 5pt 5pt.
*/
setPadding(value)
{
this.getJavaClass().setPaddingSync(value.getJavaClass());
this.padding = value;
}
/**
* Caption test horizontal alignment.<br>
* Default TextAlignment.CENTER.
*/
getAlignment()
{
return this.getJavaClass().getAlignmentSync();
}
/**
* Caption test horizontal alignment.<br>
* Default TextAlignment.CENTER.
*/
setAlignment(value)
{
this.getJavaClass().setAlignmentSync(value);
}
/**
* Specify word wraps (line breaks) within text.<br>
* Default value: false.
*/
getNoWrap()
{
return this.getJavaClass().getNoWrapSync();
}
/**
* Specify word wraps (line breaks) within text.<br>
* Default value: false.
*/
setNoWrap(value)
{
this.getJavaClass().setNoWrapSync(value);
}
}
/**
* Specifies the size value in different units (Pixel, Inches, etc.).
* @example
* //This sample shows how to create and save a BarCode image.
* let generator = new BarcodeGenerator(EncodeTypes.CODE_128);
* generator.getParameters().getBarcode().getBarHeight().setMillimeters(10);
* generator.save("test.png", BarcodeImageFormat.PNG);
*/
class Unit extends joint.BaseJavaClass
{
constructor(source)
{
super(Unit.initUnit(source));
this.init();
}
static initUnit(source)
{
if (source instanceof Unit) {
return source.getJavaClass();
}
return source;
}
init()
{
}
/**
* Gets size value in pixels.
*/
getPixels()
{
return this.getJavaClass().getPixelsSync();
}
/**
* Sets size value in pixels.
*/
setPixels(value)
{
this.getJavaClass().setPixelsSync(value);
}
/**
* Gets size value in inches.
*/
getInches()
{
return this.getJavaClass().getInchesSync();
}
/**
* Sets size value in inches.
*/
setInches(value)
{
this.getJavaClass().setInchesSync(value);
}
/**
* Gets size value in millimeters.
*/
getMillimeters()
{
return this.getJavaClass().getMillimetersSync();
}
/**
* Sets size value in millimeters.
*/
setMillimeters(value)
{
this.getJavaClass().setMillimetersSync(value);
}
/**
* Gets size value in point.
*/
getPoint()
{
return this.getJavaClass().getPointSync();
}
/**
* Sets size value in point.
*/
setPoint(value)
{
this.getJavaClass().setPointSync(value);
}
/**
* Gets size value in document units.
*/
getDocument()
{
return this.getJavaClass().getDocumentSync();
}
/**
* Sets size value in document units.
*/
setDocument(value)
{
this.getJavaClass().setDocumentSync(value);
}
/**
* Returns a human-readable string representation of this Unit.<br>
* @return A string that represents this Unit.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
/**
* Determines whether this instance and a specified object,<br>
* which must also be a Unit object, have the same value.<br>
* @param obj The Unit to compare to this instance.
* @return true if obj is a Unit and its value is the same as this instance;
* otherwise, false. If obj is null, the method returns false.
*/
equals(obj)
{
return this.getJavaClass().equalsSync(obj.getJavaClass());
}
}
/**
* Paddings parameters.
*/
class Padding extends joint.BaseJavaClass
{
top;
bottom;
right;
left;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this.top = new Unit(this.getJavaClass().getTopSync());
this.bottom = new Unit(this.getJavaClass().getBottomSync());
this.right = new Unit(this.getJavaClass().getRightSync());
this.left = new Unit(this.getJavaClass().getLeftSync());
}
/**
* Top padding.
*/
getTop()
{
return this.top;
}
/**
* Top padding.
*/
setTop(value)
{
this.getJavaClass().setTopSync(value.getJavaClass());
this.top = value;
}
/**
* Bottom padding.
*/
getBottom()
{
return this.bottom;
}
/**
* Bottom padding.
*/
setBottom(value)
{
this.getJavaClass().setBottomSync(value.getJavaClass());
this.bottom = value;
}
/**
* Right padding.
*/
getRight()
{
return this.right;
}
/**
* Right padding.
*/
setRight(value)
{
this.getJavaClass().setRightSync(value.getJavaClass());
this.right = value;
}
/**
* Left padding.
*/
getLeft()
{
return this.left;
}
/**
* Left padding.
*/
setLeft(value)
{
this.getJavaClass().setLeftSync(value.getJavaClass());
this.left = value;
}
/**
* Returns a human-readable string representation of this Padding.
* @return A string that represents this Padding.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* Codetext parameters.
*/
class CodetextParameters extends joint.BaseJavaClass
{
font;
space;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this.font = new FontUnit(this.getJavaClass().getFontSync());
this.space = new Unit(this.getJavaClass().getSpaceSync());
}
/**
* Text that will be displayed instead of codetext in 2D barcodes.<br>
* Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode
*/
getTwoDDisplayText()
{
return this.getJavaClass().getTwoDDisplayTextSync();
}
/**
* Text that will be displayed instead of codetext in 2D barcodes.<br>
* Used for: Aztec, Pdf417, DataMatrix, QR, MaxiCode, DotCode
*/
setTwoDDisplayText(value)
{
this.getJavaClass().setTwoDDisplayTextSync(value);
}
/**
* Specify FontMode. If FontMode is set to Auto, font size will be calculated automatically based on xDimension value.<br>
* It is recommended to use FontMode.AUTO especially in AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.<br>
* Default value: FontMode.AUTO.
*/
getFontMode()
{
return this.getJavaClass().getFontModeSync();
}
/**
* Specify FontMode. If FontMode is set to Auto, font size will be calculated automatically based on xDimension value.<br>
* It is recommended to use FontMode.AUTO especially in AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.<br>
* Default value: FontMode.AUTO.
*/
setFontMode(value)
{
this.getJavaClass().setFontModeSync(value);
}
/**
* Specify the displaying CodeText's font.<br>
* Default value: Arial 5pt regular.<br>
* Ignored if FontMode is set to FontMode.AUTO.
*/
getFont()
{
return this.font;
}
/**
* Specify the displaying CodeText's font.<br>
* Default value: Arial 5pt regular.<br>
* Ignored if FontMode is set to FontMode.AUTO.
*/
setFont(value)
{
this.getJavaClass().setFontSync(value.getJavaClass());
this.font = value;
}
/**
* Space between the CodeText and the BarCode in Unit value.<br>
* Default value: 2pt.<br>
* Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon.
*/
getSpace()
{
return this.space;
}
/**
* Space between the CodeText and the BarCode in Unit value.<br>
* Default value: 2pt.<br>
* Ignored for EAN8, EAN13, UPCE, UPCA, ISBN, ISMN, ISSN, UpcaGs1DatabarCoupon.
*/
setSpace(value)
{
this.getJavaClass().setSpaceSync(value.getJavaClass());
this.space = value;
}
/**
* Gets the alignment of the code text.<br>
* Default value: TextAlignment.CENTER.
*/
getAlignment()
{
return this.getJavaClass().getAlignmentSync();
}
/**
* Sets the alignment of the code text.<br>
* Default value: TextAlignment.CENTER.
*/
setAlignment(value)
{
this.getJavaClass().setAlignmentSync(value);
}
/**
* Specify the displaying CodeText's Color.<br>
* Default value BLACK.
*/
getColor()
{
let intColor = this.getJavaClass().getColorSync();
let hexColor = ((intColor) >>> 0).toString(16).slice(-6).toUpperCase()
while (hexColor.length < 6) {
hexColor = "0" + hexColor;
}
hexColor = "#" + hexColor;
return hexColor;
}
/**
* Specify the displaying CodeText's Color.<br>
* Default value BLACK.
*/
setColor(value)
{
this.getJavaClass().setColorSync((parseInt(value.substr(1), 16) << 8) / 256);
}
/**
* Specify the displaying CodeText Location, set to CodeLocation.NONE to hide CodeText.<br>
* Default value: CodeLocation.BELOW.
*/
getLocation()
{
return this.getJavaClass().getLocationSync();
}
/**
* Specify the displaying CodeText Location, set to CodeLocation.NONE to hide CodeText.<br>
* Default value: CodeLocation.NONE.
*/
setLocation(value)
{
this.getJavaClass().setLocationSync(value);
}
/**
* Specify word wraps (line breaks) within text.<br>
* Default value: false.
*/
getNoWrap()
{
return this.getJavaClass().getNoWrapSync();
}
/**
* Specify word wraps (line breaks) within text.<br>
* Default value: false.
*/
setNoWrap(value)
{
this.getJavaClass().setNoWrapSync(value);
}
/**
* Returns a human-readable string representation of this CodetextParameters.<br>
* @return A string that represents this CodetextParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* Postal parameters. Used for Postnet, Planet.
*/
class PostalParameters extends joint.BaseJavaClass
{
postalShortBarHeight;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this.postalShortBarHeight = new Unit(this.getJavaClass().getPostalShortBarHeightSync());
}
/**
* Short bar's height of Postal barcodes.
*/
getPostalShortBarHeight()
{
return this.postalShortBarHeight;
}
/**
* Short bar's height of Postal barcodes.
*/
setPostalShortBarHeight(value)
{
this.getJavaClass().setPostalShortBarHeightSync(value.getJavaClass());
this.postalShortBarHeight = value;
}
/**
* Returns a human-readable string representation of this PostalParameters.<br>
* @return A string that represents this PostalParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* AustralianPost barcode parameters.
*/
class AustralianPostParameters extends joint.BaseJavaClass
{
australianPostShortBarHeight;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this.australianPostShortBarHeight = new Unit(this.getJavaClass().getAustralianPostShortBarHeightSync());
}
/**
* Short bar's height of AustralianPost barcode.
*/
getAustralianPostShortBarHeight()
{
return this.australianPostShortBarHeight;
}
/**
* Short bar's height of AustralianPost barcode.
*/
setAustralianPostShortBarHeight(value)
{
this.getJavaClass().setAustralianPostShortBarHeightSync(value.getJavaClass());
this.australianPostShortBarHeight = value;
}
/**
* Interpreting type for the Customer Information of AustralianPost, default to CustomerInformationInterpretingType.Other"
*/
getAustralianPostEncodingTable()
{
return this.getJavaClass().getAustralianPostEncodingTableSync();
}
/**
* Interpreting type for the Customer Information of AustralianPost, default to CustomerInformationInterpretingType.Other"
*/
setAustralianPostEncodingTable(value)
{
this.getJavaClass().setAustralianPostEncodingTableSync(value);
}
/**
* Returns a human-readable string representation of this AustralianPostParameters.<br>
* @return {string} Value that represents this AustralianPostParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* Codablock parameters.
*/
class CodablockParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* Columns count.
*/
getColumns()
{
return this.getJavaClass().getColumnsSync();
}
/**
* Columns count.
*/
setColumns(value)
{
this.getJavaClass().setColumnsSync(value);
}
/**
* Rows count.
*/
getRows()
{
return this.getJavaClass().getRowsSync();
}
/**
* Rows count.
*/
setRows(value)
{
this.getJavaClass().setRowsSync(value);
}
/**
* Height/Width ratio of 2D BarCode module.
*/
getAspectRatio()
{
return this.getJavaClass().getAspectRatioSync();
}
/**
* Height/Width ratio of 2D BarCode module.
*/
setAspectRatio(value)
{
this.getJavaClass().setAspectRatioSync(java.newFloat(value));
}
/**
* Returns a human-readable string representation of this CodablockParameters. <br>
* @return {string} value that represents this CodablockParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* Databar parameters.
*/
class DataBarParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* Enables flag of 2D composite component with DataBar barcode
*/
is2DCompositeComponent()
{
return this.getJavaClass().is2DCompositeComponentSync();
}
/**
* Enables flag of 2D composite component with DataBar barcode
*/
set2DCompositeComponent(value)
{
this.getJavaClass().set2DCompositeComponentSync(value);
}
/**
* If this flag is set, it allows only GS1 encoding standard for Databar barcode types
*/
isAllowOnlyGS1Encoding()
{
return this.getJavaClass().isAllowOnlyGS1EncodingSync();
}
/**
* If this flag is set, it allows only GS1 encoding standard for Databar barcode types
*/
setAllowOnlyGS1Encoding(value)
{
this.getJavaClass().setAllowOnlyGS1EncodingSync(value);
}
/**
* Columns count.
*/
getColumns()
{
return this.getJavaClass().getColumnsSync();
}
/**
* Columns count.
*/
setColumns(value)
{
this.getJavaClass().setColumnsSync(value);
}
/**
* Rows count.
*/
getRows()
{
return this.getJavaClass().getRowsSync();
}
/**
* Rows count.
*/
setRows(value)
{
this.getJavaClass().setRowsSync(value);
}
/**
* Height/Width ratio of 2D BarCode module.
* Used for DataBar stacked.
*/
getAspectRatio()
{
return this.getJavaClass().getAspectRatioSync();
}
/**
* Height/Width ratio of 2D BarCode module.<br>
* Used for DataBar stacked.
*/
setAspectRatio(value)
{
this.getJavaClass().setAspectRatioSync(java.newFloat(value));
}
/**
* Returns a human-readable string representation of this DataBarParameters.<br>
* @return A string that represents this DataBarParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* DataMatrix parameters.
*/
class DataMatrixParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* <p>
* Gets a Datamatrix symbol size.
* Default value: DataMatrixVersion.Auto.
* </p>
*/
getDataMatrixVersion()
{
return this.getJavaClass().getDataMatrixVersionSync();
}
/**
* <p>
* Sets a Datamatrix symbol size.
* Default value: DataMatrixVersion.Auto.
* </p>
*/
setDataMatrixVersion(value)
{
this.getJavaClass().setDataMatrixVersionSync(value);
}
/**
* Gets a Datamatrix ECC type.<br>
* Default value: DataMatrixEccType.ECC_200.
*/
getDataMatrixEcc()
{
return this.getJavaClass().getDataMatrixEccSync();
}
/**
* Sets a Datamatrix ECC type.<br>
* Default value: DataMatrixEccType.ECC_200.
*/
setDataMatrixEcc(value)
{
this.getJavaClass().setDataMatrixEccSync(value);
}
/**
* Encode mode of Datamatrix barcode.<br>
* Default value: DataMatrixEncodeMode.AUTO.
*/
getDataMatrixEncodeMode()
{
return this.getJavaClass().getDataMatrixEncodeModeSync();
}
/**
* Encode mode of Datamatrix barcode.<br>
* Default value: DataMatrixEncodeMode.AUTO.
*/
setDataMatrixEncodeMode(value)
{
this.getJavaClass().setDataMatrixEncodeModeSync(value);
}
/**
* <p>
* Barcode ID for Structured Append mode of Datamatrix barcode.
* Default value: 0
* </p>
*/
getStructuredAppendBarcodeId()
{
return this.getJavaClass().getStructuredAppendBarcodeIdSync();
}
/**
* <p>
* Barcode ID for Structured Append mode of Datamatrix barcode.
* Default value: 0
* </p>
*/
setStructuredAppendBarcodeId(value)
{
this.getJavaClass().setStructuredAppendBarcodeIdSync(value);
}
/**
* <p>
* Barcodes count for Structured Append mode of Datamatrix barcode.
* Default value: 0
* </p>
*/
getStructuredAppendBarcodesCount()
{
return this.getJavaClass().getStructuredAppendBarcodesCountSync();
}
/**
* <p>
* Barcodes count for Structured Append mode of Datamatrix barcode.
* Default value: 0
* </p>
*/
setStructuredAppendBarcodesCount(value)
{
this.getJavaClass().setStructuredAppendBarcodesCountSync(value);
}
/**
* <p>
* File ID for Structured Append mode of Datamatrix barcode.
* Default value: 0
* </p>
*/
getStructuredAppendFileId()
{
return this.getJavaClass().getStructuredAppendFileIdSync();
}
/**
* <p>
* File ID for Structured Append mode of Datamatrix barcode.
* Default value: 0
* </p>
*/
setStructuredAppendFileId(value)
{
this.getJavaClass().setStructuredAppendFileIdSync(value);
}
/**
* <p>
* Used to instruct the reader to interpret the data contained within the symbol
* as programming for reader initialization.
* Default value: false
* </p>
*/
isReaderProgramming()
{
return this.getJavaClass().isReaderProgrammingSync();
}
/**
* <p>
* Used to instruct the reader to interpret the data contained within the symbol
* as programming for reader initialization.
* Default value: false
* </p>
*/
setReaderProgramming(value)
{
this.getJavaClass().setReaderProgrammingSync(value);
}
/**
* ISO/IEC 16022<br>
* 5.2.4.7 Macro characters<br>
* 11.3 Protocol for Macro characters in the first position (ECC 200 only)<br>
* Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes.<br>
* Can be used only with DataMatrixEccType.ECC_200 or DataMatrixEccType.ECC_AUTO.<br>
* Cannot be used with EncodeTypes.GS_1_DATA_MATRIX<br>
* Default value: MacroCharacter.NONE.
*/
getMacroCharacters()
{
return this.getJavaClass().getMacroCharactersSync();
}
/**
* ISO/IEC 16022<br>
* 5.2.4.7 Macro characters<br>
* 11.3 Protocol for Macro characters in the first position (ECC 200 only)<br>
* Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes.<br>
* Can be used only with DataMatrixEccType.ECC_200 or DataMatrixEccType.ECC_AUTO.<br>
* Cannot be used with EncodeTypes.GS_1_DATA_MATRIX<br>
* Default value: MacroCharacter.NONE.
*/
setMacroCharacters(value)
{
this.getJavaClass().setMacroCharactersSync(value);
}
/**
* Columns count.
*/
getColumns()
{
return this.getJavaClass().getColumnsSync();
}
/**
* Columns count.
*/
setColumns(value)
{
this.getJavaClass().setColumnsSync(value);
}
/**
* Rows count.
*/
getRows()
{
return this.getJavaClass().getRowsSync();
}
/**
* Rows count.
*/
setRows(value)
{
this.getJavaClass().setRowsSync(value);
}
/**
* Height/Width ratio of 2D BarCode module.
*/
getAspectRatio()
{
return this.getJavaClass().getAspectRatioSync();
}
/**
* Height/Width ratio of 2D BarCode module.
*/
setAspectRatio(value)
{
this.getJavaClass().setAspectRatioSync(java.newFloat(value));
}
/**
* <p>
* Gets ECI encoding. Used when DataMatrixEncodeMode is Auto.
* Default value: ISO-8859-1
* </p>
*/
getECIEncoding()
{
return this.getJavaClass().getECIEncodingSync();
}
/**
* <p>
* Sets ECI encoding. Used when DataMatrixEncodeMode is Auto.
* Default value: ISO-8859-1
* </p>
*/
setECIEncoding(value)
{
this.getJavaClass().setECIEncodingSync(value);
}
/**
* Returns a human-readable string representation of this DataMatrixParameters.<br>
* @return presentation of this DataMatrixParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* PatchCode parameters.
*/
class PatchCodeParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* Specifies codetext for an extra QR barcode, when PatchCode is generated in page mode.
*/
getExtraBarcodeText()
{
return this.getJavaClass().getExtraBarcodeTextSync();
}
/**
* Specifies codetext for an extra QR barcode, when PatchCode is generated in page mode.
*/
setExtraBarcodeText(value)
{
this.getJavaClass().setExtraBarcodeTextSync(value);
}
/**
* PatchCode format. Choose PatchOnly to generate single PatchCode. Use page format to generate Patch page with PatchCodes as borders.<br>
* Default value: PatchFormat.PATCH_ONLY
*
* @return PatchFormat
*/
getPatchFormat()
{
return this.getJavaClass().getPatchFormatSync();
}
/**
* PatchCode format. Choose PatchOnly to generate single PatchCode. Use page format to generate Patch page with PatchCodes as borders.<br>
* Default value: PatchFormat.PATCH_ONLY
*/
setPatchFormat(value)
{
this.getJavaClass().setPatchFormatSync(value);
}
/**
* Returns a human-readable string representation of this {PatchCodeParameters}<br>
* @return string value that represents PatchCodeParameters
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* Code16K parameters.
*/
class Code16KParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* Height/Width ratio of 2D BarCode module.
*/
getAspectRatio()
{
return this.getJavaClass().getAspectRatioSync();
}
/**
* Height/Width ratio of 2D BarCode module.
*/
setAspectRatio(value)
{
this.getJavaClass().setAspectRatioSync(java.newFloat(value));
}
/**
* Size of the left quiet zone in xDimension.<br>
* Default value: 10, meaning if xDimension = 2px than left quiet zone will be 20px.
*/
getQuietZoneLeftCoef()
{
return this.getJavaClass().getQuietZoneLeftCoefSync();
}
/**
* Size of the left quiet zone in xDimension.<br>
* Default value: 10, meaning if xDimension = 2px than left quiet zone will be 20px.
*/
setQuietZoneLeftCoef(value)
{
this.getJavaClass().setQuietZoneLeftCoefSync(value);
}
/**
* Size of the right quiet zone in xDimension.<br>
* Default value: 1, meaning if xDimension = 2px than right quiet zone will be 2px.
*/
getQuietZoneRightCoef()
{
return this.getJavaClass().getQuietZoneRightCoefSync();
}
/**
* Size of the right quiet zone in xDimension.<br>
* Default value: 1, meaning if xDimension = 2px than right quiet zone will be 2px.
*/
setQuietZoneRightCoef(value)
{
this.getJavaClass().setQuietZoneRightCoefSync(value);
}
/**
* Returns a human-readable string representation of this Code16KParameters.<br>
* @return A string that represents this Code16KParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* DotCode parameters.
*/
class DotCodeParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* Identifies DotCode encode mode.<br>
* Default value: Auto.
*/
getDotCodeEncodeMode()
{
return this.getJavaClass().getDotCodeEncodeModeSync();
}
/**
* <p>
* Identifies DotCode encode mode.
* </p>
* Default value: Auto.
*/
setDotCodeEncodeMode(value)
{
this.getJavaClass().setDotCodeEncodeModeSync(value);
}
/**
* <p>
* Indicates whether code is used for instruct reader to interpret the following data as instructions for initialization or reprogramming of the bar code reader.
* </p>
* Default value is false.
*/
isReaderInitialization()
{
return this.getJavaClass().isReaderInitializationSync();
}
/**
* <p>
* Indicates whether code is used for instruct reader to interpret the following data as instructions for initialization or reprogramming of the bar code reader.
* </p>
* Default value is false.
*/
setReaderInitialization(value)
{
this.getJavaClass().setReaderInitializationSync(value);
}
/**
* <p>
* Identifies the ID of the DotCode structured append mode barcode. ID starts from 1 and must be less or equal to barcodes count. Default value is -1.
* </p>
*/
getDotCodeStructuredAppendModeBarcodeId()
{
return this.getJavaClass().getDotCodeStructuredAppendModeBarcodeIdSync();
}
/**
* <p>
* Identifies the ID of the DotCode structured append mode barcode. ID starts from 1 and must be less or equal to barcodes count. Default value is -1.
* </p>
*/
setDotCodeStructuredAppendModeBarcodeId(value)
{
this.getJavaClass().setDotCodeStructuredAppendModeBarcodeIdSync(value);
}
/**
* <p>
* Identifies DotCode structured append mode barcodes count. Default value is -1. Count must be a value from 1 to 35.
* </p>
*/
getDotCodeStructuredAppendModeBarcodesCount()
{
return this.getJavaClass().getDotCodeStructuredAppendModeBarcodesCountSync();
}
/**
* <p>
* Identifies DotCode structured append mode barcodes count. Default value is -1. Count must be a value from 1 to 35.
* </p>
*/
setDotCodeStructuredAppendModeBarcodesCount(value)
{
this.getJavaClass().setDotCodeStructuredAppendModeBarcodesCountSync(value);
}
/**
* <p>
* Identifies ECI encoding. Used when DotCodeEncodeMode is AUTO.
* </p>
* Default value: ISO-8859-1
*/
getECIEncoding()
{
return this.getJavaClass().getECIEncodingSync();
}
/**
* <p>
* Identifies ECI encoding. Used when DotCodeEncodeMode is AUTO.<br>
* Default value: ISO-8859-1
* </p>
*/
setECIEncoding(value)
{
this.getJavaClass().setECIEncodingSync(value);
}
/**
* <p>
* Identifies rows count. Sum of the number of rows plus the number of columns of a DotCode symbol must be odd. Number of rows must be at least 5.
* </p>
* Default value: -1
*/
getRows()
{
return this.getJavaClass().getRowsSync();
}
/**
* <p>
* Identifies rows count. Sum of the number of rows plus the number of columns of a DotCode symbol must be odd. Number of rows must be at least 5.
* </p>
* Default value: -1
*/
setRows(value)
{
this.getJavaClass().setRowsSync(value);
}
/**
* <p>
* Identifies columns count. Sum of the number of rows plus the number of columns of a DotCode symbol must be odd. Number of columns must be at least 5.
* </p>
* Default value: -1
*/
getColumns()
{
return this.getJavaClass().getColumnsSync();
}
/**
* <p>
* Identifies columns count. Sum of the number of rows plus the number of columns of a DotCode symbol must be odd. Number of columns must be at least 5.
* </p>
* Default value: -1
*/
setColumns(value)
{
this.getJavaClass().setColumnsSync(value);
}
/**
* Height/Width ratio of 2D BarCode module.
*/
getAspectRatio()
{
return this.getJavaClass().getAspectRatioSync();
}
/**
* Height/Width ratio of 2D BarCode module.
*/
setAspectRatio(value)
{
this.getJavaClass().setAspectRatioSync(java.newFloat(value));
}
/**
* Returns a human-readable string representation of this DotCodeParameters.<br>
* @return A string that represents this DotCodeParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* GS1 Composite bar parameters.
*/
class GS1CompositeBarParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* Linear component type
*/
getLinearComponentType()
{
return this.getJavaClass().getLinearComponentTypeSync();
}
/**
* Linear component type
*/
setLinearComponentType(value)
{
this.getJavaClass().setLinearComponentTypeSync(value);
}
/**
* 2D component type
*/
getTwoDComponentType()
{
return this.getJavaClass().getTwoDComponentTypeSync();
}
/**
* 2D component type
*/
setTwoDComponentType(value)
{
this.getJavaClass().setTwoDComponentTypeSync(value);
}
/**
* <p>
* If this flag is set, it allows only GS1 encoding standard for GS1CompositeBar 2D Component
* </p>
*/
isAllowOnlyGS1Encoding()
{
return this.getJavaClass().isAllowOnlyGS1EncodingSync();
}
/**
* <p>
* If this flag is set, it allows only GS1 encoding standard for GS1CompositeBar 2D Component
* </p>
*/
setAllowOnlyGS1Encoding(value)
{
this.getJavaClass().setAllowOnlyGS1EncodingSync(value);
}
/**
* Returns a human-readable string representation of this DataBarParameters.
* @return A string that represents this DataBarParameters
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* ITF parameters.
*/
class ITFParameters extends joint.BaseJavaClass
{
itfBorderThickness;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this.itfBorderThickness = new Unit(this.getJavaClass().getItfBorderThicknessSync());
}
/**
* Gets an ITF border (bearer bar) thickness in Unit value.<br>
* Default value: 12pt.
*/
getItfBorderThickness()
{
return this.itfBorderThickness;
}
/**
* Sets an ITF border (bearer bar) thickness in Unit value.<br>
* Default value: 12pt.
*/
setItfBorderThickness(value)
{
this.getJavaClass().setItfBorderThicknessSync(value.getJavaClass());
this.itfBorderThickness = value;
}
/**
* Border type of ITF barcode.<br>
* Default value: ITF14BorderType.BAR.
*/
getItfBorderType()
{
return this.getJavaClass().getItfBorderTypeSync();
}
/**
* Border type of ITF barcode.<br>
* Default value: ITF14BorderType.BAR.
*/
setItfBorderType(value)
{
this.getJavaClass().setItfBorderTypeSync(value);
}
/**
* Size of the quiet zones in xDimension.<br>
* Default value: 10, meaning if xDimension = 2px than quiet zones will be 20px.<br>
* @exception IllegalArgumentException
* The QuietZoneCoef parameter value is less than 10.
*/
getQuietZoneCoef()
{
return this.getJavaClass().getQuietZoneCoefSync();
}
/**
* Size of the quiet zones in xDimension.<br>
* Default value: 10, meaning if xDimension = 2px than quiet zones will be 20px.<br>
* @exception IllegalArgumentException
* The QuietZoneCoef parameter value is less than 10.
*/
setQuietZoneCoef(value)
{
this.getJavaClass().setQuietZoneCoefSync(value);
}
/**
* Returns a human-readable string representation of this ITFParameters.<br>
* @return A string that represents this ITFParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* QR parameters.
*/
class QrParameters extends joint.BaseJavaClass
{
structuredAppend;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this.structuredAppend = new QrStructuredAppendParameters(this.getJavaClass().getStructuredAppendSync());
}
/**
* QR structured append parameters.
*/
getStructuredAppend()
{
return this.structuredAppend;
}
/**
* QR structured append parameters.
*/
setStructuredAppend(value)
{
this.structuredAppend = value;
this.getJavaClass().setStructuredAppendSync(value.getJavaClass());
}
/**
* Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details<br>
* about the used references for encoding the data in the symbol.<br>
* Current implementation consists all well known charset encodings.
*/
getQrECIEncoding()
{
return this.getJavaClass().getQrECIEncodingSync();
}
/**
* Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details<br>
* about the used references for encoding the data in the symbol.<br>
* Current implementation consists all well known charset encodings.
*/
setQrECIEncoding(value)
{
this.getJavaClass().setQrECIEncodingSync(value);
}
/**
* QR symbology type of BarCode's encoding mode.<br>
* Default value: QREncodeMode.AUTO.
*/
getQrEncodeMode()
{
return this.getJavaClass().getQrEncodeModeSync();
}
/**
* QR symbology type of BarCode's encoding mode.<br>
* Default value: QREncodeMode.AUTO.
*/
setQrEncodeMode(value)
{
console.log("JS QrParameters.setQrEncodeMode(" + value + ")\n")
this.getJavaClass().setQrEncodeModeSync(value);
}
/**
* QR / MicroQR selector mode. Select ForceQR for standard QR symbols, Auto for MicroQR.
*/
getQrEncodeType()
{
let value = this.getJavaClass().getQrEncodeTypeSync();
return value;
}
/**
* QR / MicroQR selector mode. Select ForceQR for standard QR symbols, Auto for MicroQR.
*/
setQrEncodeType(value)
{
this.getJavaClass().setQrEncodeTypeSync(value);
}
/**
* Level of Reed-Solomon error correction for QR barcode.<br>
* From low to high: LEVEL_L, LEVEL_M, LEVEL_Q, LEVEL_H. see QRErrorLevel.
*/
getQrErrorLevel()
{
return this.getJavaClass().getQrErrorLevelSync();
}
/**
* Level of Reed-Solomon error correction for QR barcode.<br>
* From low to high: LEVEL_L, LEVEL_M, LEVEL_Q, LEVEL_H. see QRErrorLevel.
*/
setQrErrorLevel(value)
{
this.getJavaClass().setQrErrorLevelSync(value);
}
/**
* Version of QR Code.<br>
* From Version1 to Version40 for QR code and from M1 to M4 for MicroQr.<br>
* Default value is QRVersion.AUTO.
*/
getQrVersion()
{
return this.getJavaClass().getQrVersionSync();
}
/**
* Version of QR Code.<br>
* From Version1 to Version40 for QR code and from M1 to M4 for MicroQr.<br>
* Default value is QRVersion.AUTO.
*/
setQrVersion(value)
{
this.getJavaClass().setQrVersionSync(value);
}
/**
* <p>
* Version of MicroQR Code. From version M1 to version M4.
* Default value is MicroQRVersion.Auto.
* </p>
*/
getMicroQRVersion()
{
return this.getJavaClass().getMicroQRVersionSync();
}
/**
* <p>
* Version of MicroQR Code. From version M1 to version M4.
* Default value is MicroQRVersion.Auto.
* </p>
*/
setMicroQRVersion(value)
{
this.getJavaClass().setMicroQRVersionSync(value);
}
/**
* <p>
* Version of RectMicroQR Code. From version R7x59 to version R17x139.
* Default value is RectMicroQRVersion.Auto.
* </p>
*/
getRectMicroQrVersion()
{
return this.getJavaClass().getRectMicroQrVersionSync();
}
/**
* <p>
* Version of RectMicroQR Code. From version R7x59 to version R17x139.
* Default value is RectMicroQRVersion.Auto.
* </p>
*/
setRectMicroQrVersion(value)
{
this.getJavaClass().setRectMicroQrVersionSync(value);
}
/**
* Height/Width ratio of 2D BarCode module.
*/
getAspectRatio()
{
return this.getJavaClass().getAspectRatioSync();
}
/**
* Height/Width ratio of 2D BarCode module.
*/
setAspectRatio(value)
{
this.getJavaClass().setAspectRatioSync(java.newFloat(value));
}
/**
* Returns a human-readable string representation of this QrParameters.<br>
* @return A string that represents this QrParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* <p>
* PDF417 parameters. Contains PDF417, MacroPDF417, MicroPDF417 and GS1MicroPdf417 parameters.
* MacroPDF417 requires two fields: Pdf417MacroFileID and Pdf417MacroSegmentID. All other fields are optional.
* MicroPDF417 in Structured Append mode (same as MacroPDF417 mode) requires two fields: Pdf417MacroFileID and Pdf417MacroSegmentID. All other fields are optional.
* <pre>
* These samples show how to encode UCC/EAN-128 non Linked modes in GS1MicroPdf417
* <pre>
*
* @example
* # Encodes GS1 UCC/EAN-128 non Linked mode 905 with AI 01 (GTIN)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(01)12345678901231");
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log( result.getCodeText());
* });
*
* @example
* # Encodes GS1 UCC/EAN-128 non Linked modes 903, 904 with any AI
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(241)123456789012345(241)ABCD123456789012345");
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log( result.getCodeText());
* });
* </pre>
* </pre>
* </p>
*/
class Pdf417Parameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* Pdf417 symbology type of BarCode's compaction mode.<br>
* Default value: Pdf417CompactionMode.AUTO.
*/
getPdf417CompactionMode()
{
return this.getJavaClass().getPdf417CompactionModeSync();
}
/**
* Pdf417 symbology type of BarCode's compaction mode.<br>
* Default value: Pdf417CompactionMode.AUTO.
*/
setPdf417CompactionMode(value)
{
this.getJavaClass().setPdf417CompactionModeSync(value);
}
/**
* Identifies Pdf417 encode mode.
* Default value: Auto.
*/
getPdf417EncodeMode()
{
return this.getJavaClass().getPdf417EncodeModeSync();
}
/**
* Identifies Pdf417 encode mode.
* Default value: Auto.
*/
setPdf417EncodeMode(pdf417EncodeMode)
{
this.getJavaClass().setPdf417EncodeModeSync(pdf417EncodeMode);
}
/**
* Gets Pdf417 symbology type of BarCode's error correction level<br>
* ranging from level0 to level8, level0 means no error correction info,<br>
* level8 means best error correction which means a larger picture.
*/
getPdf417ErrorLevel()
{
return this.getJavaClass().getPdf417ErrorLevelSync();
}
/**
* Sets Pdf417 symbology type of BarCode's error correction level<br>
* ranging from level0 to level8, level0 means no error correction info,<br>
* level8 means best error correction which means a larger picture.
*/
setPdf417ErrorLevel(value)
{
this.getJavaClass().setPdf417ErrorLevelSync(value);
}
/**
* Whether Pdf417 symbology type of BarCode is truncated (to reduce space).
*/
getPdf417Truncate()
{
return this.getJavaClass().getPdf417TruncateSync();
}
/**
* Whether Pdf417 symbology type of BarCode is truncated (to reduce space).
*/
setPdf417Truncate(value)
{
this.getJavaClass().setPdf417TruncateSync(value);
}
/**
* Columns count.
*/
getColumns()
{
return this.getJavaClass().getColumnsSync();
}
/**
* Columns count.
*/
setColumns(value)
{
this.getJavaClass().setColumnsSync(value);
}
/**
* Rows count.
*/
getRows()
{
return this.getJavaClass().getRowsSync();
}
/**
* Rows count.
*/
setRows(value)
{
this.getJavaClass().setRowsSync(value);
}
/**
* Height/Width ratio of 2D BarCode module.
*/
getAspectRatio()
{
return this.getJavaClass().getAspectRatioSync();
}
/**
* Height/Width ratio of 2D BarCode module.
*/
setAspectRatio(value)
{
this.getJavaClass().setAspectRatioSync(java.newFloat(value));
}
/**
* Getsmacro Pdf417 barcode's file ID.<br>
* Used for MacroPdf417.
*/
getPdf417MacroFileID()
{
return this.getJavaClass().getPdf417MacroFileIDSync();
}
/**
* Sets macro Pdf417 barcode's file ID.<br>
* Used for MacroPdf417.
*/
setPdf417MacroFileID(value)
{
this.getJavaClass().setPdf417MacroFileIDSync(value);
}
/**
* Gets macro Pdf417 barcode's segment ID, which starts from 0, to MacroSegmentsCount - 1.
*/
getPdf417MacroSegmentID()
{
return this.getJavaClass().getPdf417MacroSegmentIDSync();
}
/**
* Sets macro Pdf417 barcode's segment ID, which starts from 0, to MacroSegmentsCount - 1.
*/
setPdf417MacroSegmentID(value)
{
this.getJavaClass().setPdf417MacroSegmentIDSync(value);
}
/**
* Gets macro Pdf417 barcode segments count.
*/
getPdf417MacroSegmentsCount()
{
return this.getJavaClass().getPdf417MacroSegmentsCountSync();
}
/**
* Sets macro Pdf417 barcode segments count.
*/
setPdf417MacroSegmentsCount(value)
{
this.getJavaClass().setPdf417MacroSegmentsCountSync(value);
}
/**
* Gets macro Pdf417 barcode file name.
*/
getPdf417MacroFileName()
{
return this.getJavaClass().getPdf417MacroFileNameSync();
}
/**
* Sets macro Pdf417 barcode file name.
*/
setPdf417MacroFileName(value)
{
this.getJavaClass().setPdf417MacroFileNameSync(value);
}
/**
* Gets macro Pdf417 barcode time stamp.
*/
getPdf417MacroTimeStamp()
{
return new Date(this.getJavaClass().getPdf417MacroTimeStampSync() * 1000);
}
/**
* Sets macro Pdf417 barcode time stamp.
*/
setPdf417MacroTimeStamp(value)
{
this.getJavaClass().setPdf417MacroTimeStampSync((value.getTime() / 1000).toString());
}
/**
* Gets macro Pdf417 barcode sender name.
*/
getPdf417MacroSender()
{
return this.getJavaClass().getPdf417MacroSenderSync();
}
/**
* Sets macro Pdf417 barcode sender name.
*/
setPdf417MacroSender(value)
{
this.getJavaClass().setPdf417MacroSenderSync(value);
}
/**
* Gets macro Pdf417 barcode addressee name.
*/
getPdf417MacroAddressee()
{
return this.getJavaClass().getPdf417MacroAddresseeSync();
}
/**
* Sets macro Pdf417 barcode addressee name.
*/
setPdf417MacroAddressee(value)
{
this.getJavaClass().setPdf417MacroAddresseeSync(value);
}
/**
* Gets macro Pdf417 file size.<br>
* @return The file size field contains the size in bytes of the entire source file.
*/
getPdf417MacroFileSize()
{
return this.getJavaClass().getPdf417MacroFileSizeSync();
}
/**
* Sets macro Pdf417 file size.<br>
* @param value The file size field contains the size in bytes of the entire source file.
*/
setPdf417MacroFileSize(value)
{
this.getJavaClass().setPdf417MacroFileSizeSync(value);
}
/**
* Gets macro Pdf417 barcode checksum.<br>
* @return The checksum field contains the value of the 16-bit (2 bytes) CRC checksum using the CCITT-16 polynomial.
*/
getPdf417MacroChecksum()
{
return this.getJavaClass().getPdf417MacroChecksumSync();
}
/**
* Sets macro Pdf417 barcode checksum.<br>
* @param value The checksum field contains the value of the 16-bit (2 bytes) CRC checksum using the CCITT-16 polynomial.
*/
setPdf417MacroChecksum(value)
{
this.getJavaClass().setPdf417MacroChecksumSync(value);
}
/**
* Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details<br>
* about the used references for encoding the data in the symbol.<br>
* Current implementation consists all well known charset encodings.
*/
getPdf417ECIEncoding()
{
return this.getJavaClass().getPdf417ECIEncodingSync();
}
/**
* Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details<br>
* about the used references for encoding the data in the symbol.<br>
* Current implementation consists all well known charset encodings.
*/
setPdf417ECIEncoding(value)
{
this.getJavaClass().setPdf417ECIEncodingSync(value);
}
/**
* Extended Channel Interpretation Identifiers. Applies for Macro PDF417 text fields.
*/
getPdf417MacroECIEncoding()
{
return this.getJavaClass().getPdf417MacroECIEncodingSync();
}
/**
* Extended Channel Interpretation Identifiers. Applies for Macro PDF417 text fields.
*/
setPdf417MacroECIEncoding(value)
{
this.getJavaClass().setPdf417MacroECIEncodingSync(value);
}
/**
* Used to tell the encoder whether to add Macro PDF417 Terminator (codeword 922) to the segment.<br>
* Applied only for Macro PDF417.
*/
getPdf417MacroTerminator()
{
return this.getJavaClass().getPdf417MacroTerminatorSync();
}
/**
* Used to tell the encoder whether to add Macro PDF417 Terminator (codeword 922) to the segment.<br>
* Applied only for Macro PDF417.
*/
setPdf417MacroTerminator(value)
{
this.getJavaClass().setPdf417MacroTerminatorSync(value);
}
/**
* Used to instruct the reader to interpret the data contained within the symbol<br>
* as programming for reader initialization<br>
* @return boolean value
*/
isReaderInitialization()
{
return this.getJavaClass().isReaderInitializationSync();
}
/**
* Used to instruct the reader to interpret the data contained within the symbol<br>
* as programming for reader initialization<br>
* @param value
*/
setReaderInitialization(value)
{
this.getJavaClass().setReaderInitializationSync(value);
}
/**
* <p>
* Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes.
* Can be used only with MicroPdf417 and encodes 916 and 917 MicroPdf417 modes
* Default value: MacroCharacters.None.
* </p><p><hr><blockquote><pre>
* These samples show how to encode Macro Characters in MicroPdf417
* <pre>
* @example
* # Encodes MicroPdf417 with 05 Macro the string: "[)>\u001E05\u001Dabcde1234\u001E\u0004"
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "abcde1234");
* generator.getParameters().getBarcode().getPdf417().setMacroCharacters(MacroCharacter.MACRO_05);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log( result.getCodeText());
* });
*
* @example
* # Encodes MicroPdf417 with 06 Macro the string: "[)>\u001E06\u001Dabcde1234\u001E\u0004"
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "abcde1234");
* generator.getParameters().getBarcode().getPdf417().setMacroCharacters(MacroCharacter.MACRO_06);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText());
* });
* </pre>
* </pre></blockquote></hr></p>
*/
getMacroCharacters()
{
return this.getJavaClass().getMacroCharactersSync();
}
/**
* <p>
* Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes.
* Can be used only with MicroPdf417 and encodes 916 and 917 MicroPdf417 modes
* Default value: MacroCharacters.None.
* </p><p><hr><blockquote><pre>
* These samples show how to encode Macro Characters in MicroPdf417
* <pre>
*
* @example
* # Encodes MicroPdf417 with 05 Macro the string: "[)>\u001E05\u001Dabcde1234\u001E\u0004"
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "abcde1234");
* generator.getParameters().getBarcode().getPdf417().setMacroCharacters(MacroCharacter.MACRO_05);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log( result.getCodeText());
* });
*
* @example
* # Encodes MicroPdf417 with 06 Macro the string: "[)>\u001E06\u001Dabcde1234\u001E\u0004"
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "abcde1234");
* generator.getParameters().getBarcode().getPdf417().setMacroCharacters(MacroCharacter.MACRO_06);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log( result.getCodeText());
* });
* </pre>
* </pre></blockquote></hr></p>
*/
setMacroCharacters(value)
{
this.getJavaClass().setMacroCharactersSync(value);
}
/**
* <p>
* Defines linked modes with GS1MicroPdf417, MicroPdf417 and Pdf417 barcodes
* With GS1MicroPdf417 symbology encodes 906, 907, 912, 913, 914, 915 “Linked” UCC/EAN-128 modes
* With MicroPdf417 and Pdf417 symbologies encodes 918 linkage flag to associated linear component other than an EAN.UCC
* </p><p><hr><blockquote><pre>
* These samples show how to encode "Linked" UCC/EAN-128 modes in GS1MicroPdf417 and Linkage Flag (918) in MicroPdf417 and Pdf417 barcodes
* <pre>
*
* @example
* # Encodes GS1 Linked mode 912 with date field AI 11 (Production date) and AI 10 (Lot number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(11)991231(10)ABCD");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked mode 912 with date field AI 13 (Packaging date) and AI 21 (Serial number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(13)991231(21)ABCD");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked mode 912 with date field AI 15 (Sell-by date) and AI 10 (Lot number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(15)991231(10)ABCD");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked mode 912 with date field AI 17 (Expiration date) and AI 21 (Serial number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(17)991231(21)ABCD");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked mode 914 with AI 10 (Lot number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(10)ABCD12345");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked mode 915 with AI 21 (Serial number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(21)ABCD12345");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked modes 906, 907 with any AI
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(240)123456789012345");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes MicroPdf417 NON EAN.UCC Linked mode 918
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "ABCDE123456789012345678");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes Pdf417 NON EAN.UCC Linked mode 918
* let generator = new BarcodeGenerator(EncodeTypes.PDF_417, "ABCDE123456789012345678");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
* </pre>
* </pre></blockquote></hr></p>
*/
isLinked()
{
return this.getJavaClass().isLinkedSync();
}
/**
* <p>
* Defines linked modes with GS1MicroPdf417, MicroPdf417 and Pdf417 barcodes
* With GS1MicroPdf417 symbology encodes 906, 907, 912, 913, 914, 915 “Linked” UCC/EAN-128 modes
* With MicroPdf417 and Pdf417 symbologies encodes 918 linkage flag to associated linear component other than an EAN.UCC
* </p><p><hr><blockquote><pre>
* These samples show how to encode "Linked" UCC/EAN-128 modes in GS1MicroPdf417 and Linkage Flag (918) in MicroPdf417 and Pdf417 barcodes
* <pre>
*
*
* @example
* # Encodes GS1 Linked mode 912 with date field AI 11 (Production date) and AI 10 (Lot number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(11)991231(10)ABCD");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked mode 912 with date field AI 13 (Packaging date) and AI 21 (Serial number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(13)991231(21)ABCD");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked mode 912 with date field AI 15 (Sell-by date) and AI 10 (Lot number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(15)991231(10)ABCD");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked mode 912 with date field AI 17 (Expiration date) and AI 21 (Serial number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(17)991231(21)ABCD");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked mode 914 with AI 10 (Lot number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(10)ABCD12345");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked mode 915 with AI 21 (Serial number)
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(21)ABCD12345");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes GS1 Linked modes 906, 907 with any AI
* let generator = new BarcodeGenerator(EncodeTypes.GS_1_MICRO_PDF_417, "(240)123456789012345");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS_1_MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes MicroPdf417 NON EAN.UCC Linked mode 918
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "ABCDE123456789012345678");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
*
* @example
* # Encodes Pdf417 NON EAN.UCC Linked mode 918
* let generator = new BarcodeGenerator(EncodeTypes.PDF_417, "ABCDE123456789012345678");
* generator.getParameters().getBarcode().getPdf417().setLinked(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsLinked:" + result.getExtended().getPdf417().isLinked();
* });
* </pre>
* </pre></blockquote></hr></p>
*/
setLinked(value)
{
this.getJavaClass().setLinkedSync(value);
}
/**
* <p>
* Can be used only with MicroPdf417 and encodes Code 128 emulation modes
* Can encode FNC1 in second position modes 908 and 909, also can encode 910 and 911 which just indicate that recognized MicroPdf417 can be interpret as Code 128
* </p><p><hr><blockquote><pre>
* These samples show how to encode Code 128 emulation modes with FNC1 in second position and without. In this way MicroPdf417 can be decoded as Code 128 barcode
* <pre>
*
* @example
* # Encodes MicroPdf417 in Code 128 emulation mode with FNC1 in second position and Application Indicator "a", mode 908.
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "a\u001d1222322323");
* generator.getParameters().getBarcode().getPdf417().setCode128Emulation(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsCode128Emulation:" + result.getExtended().getPdf417().isCode128Emulation());
* });
*
* @example
* # Encodes MicroPdf417 in Code 128 emulation mode with FNC1 in second position and Application Indicator "99", mode 909.
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "99\u001d1222322323");
* generator.getParameters().getBarcode().getPdf417().setCode128Emulation(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsCode128Emulation:" + result.getExtended().getPdf417().isCode128Emulation());
* });
*
* @example
* # Encodes MicroPdf417 in Code 128 emulation mode, modes 910, 911
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "123456789012345678");
* generator.getParameters().getBarcode().getPdf417().setCode128Emulation(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsCode128Emulation:" + result.getExtended().getPdf417().isCode128Emulation());
* });
* </pre>
* </pre></blockquote></hr></p>
*/
isCode128Emulation()
{
return this.getJavaClass().isCode128EmulationSync();
}
/**
* <p>
* Can be used only with MicroPdf417 and encodes Code 128 emulation modes
* Can encode FNC1 in second position modes 908 and 909, also can encode 910 and 911 which just indicate that recognized MicroPdf417 can be interpret as Code 128
* </p><p><hr><blockquote><pre>
* These samples show how to encode Code 128 emulation modes with FNC1 in second position and without. In this way MicroPdf417 can be decoded as Code 128 barcode
* <pre>
*
* @example
* # Encodes MicroPdf417 in Code 128 emulation mode with FNC1 in second position and Application Indicator "a", mode 908.
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "a\u001d1222322323");
* generator.getParameters().getBarcode().getPdf417().setCode128Emulation(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsCode128Emulation:" + result.getExtended().getPdf417().isCode128Emulation());
* });
*
* @example
* # Encodes MicroPdf417 in Code 128 emulation mode with FNC1 in second position and Application Indicator "99", mode 909.
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "99\u001d1222322323");
* generator.getParameters().getBarcode().getPdf417().setCode128Emulation(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsCode128Emulation:" + result.getExtended().getPdf417().isCode128Emulation());
* });
*
* @example
* # Encodes MicroPdf417 in Code 128 emulation mode, modes 910, 911
* let generator = new BarcodeGenerator(EncodeTypes.MICRO_PDF_417, "123456789012345678");
* generator.getParameters().getBarcode().getPdf417().setCode128Emulation(true);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log(result.getCodeText() + " IsCode128Emulation:" + result.getExtended().getPdf417().isCode128Emulation());
* });
* </pre>
* </pre></blockquote></hr></p>
*/
setCode128Emulation(value)
{
this.getJavaClass().setCode128EmulationSync(value);
}
/**
* Returns a human-readable string representation of this Pdf417Parameters.<br>
* @return A string that represents this Pdf417Parameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN.
*/
class SupplementParameters extends joint.BaseJavaClass
{
_space;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this._space = new Unit(this.getJavaClass().getSupplementSpaceSync());
}
/**
* Supplement data following BarCode.
*/
getSupplementData()
{
return this.getJavaClass().getSupplementDataSync();
}
/**
* Supplement data following BarCode.
*/
setSupplementData(value)
{
this.getJavaClass().setSupplementDataSync(value);
}
/**
* Space between main the BarCode and supplement BarCode in Unit value.<br>
* @exception IllegalArgumentException<br>
* The Space parameter value is less than 0.
*/
getSupplementSpace()
{
return this._space;
}
/**
* Returns a human-readable string representation of this SupplementParameters.<br>
* @return A string that represents this SupplementParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* MaxiCode parameters.
*/
class MaxiCodeParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* Gets a MaxiCode encode mode.
*/
getMaxiCodeMode()
{
return this.getJavaClass().getMaxiCodeModeSync();
}
/**
* Sets a MaxiCode encode mode.
*/
setMaxiCodeMode(maxiCodeMode)
{
this.getJavaClass().setMaxiCodeModeSync(maxiCodeMode);
}
/**
* Gets a MaxiCode encode mode.
*/
getMaxiCodeEncodeMode()
{
return this.getJavaClass().getMaxiCodeEncodeModeSync();
}
/**
* Sets a MaxiCode encode mode.
*/
setMaxiCodeEncodeMode(value)
{
this.getJavaClass().setMaxiCodeEncodeModeSync(value);
}
/**
* Gets ECI encoding. Used when MaxiCodeEncodeMode is AUTO.
* Default value: ISO-8859-1
*/
getECIEncoding()
{
return this.getJavaClass().getECIEncodingSync();
}
/**
* Sets ECI encoding. Used when MaxiCodeEncodeMode is AUTO.<br>
* Default value: ISO-8859-1
*/
setECIEncoding(ECIEncoding)
{
this.getJavaClass().setECIEncodingSync(ECIEncoding);
}
/**
* Gets a MaxiCode barcode id in structured append mode.<br>
* ID must be a value between 1 and 8.<br>
* Default value: 0
*/
getMaxiCodeStructuredAppendModeBarcodeId()
{
return this.getJavaClass().getMaxiCodeStructuredAppendModeBarcodeIdSync();
}
/**
* Sets a MaxiCode barcode id in structured append mode.<br>
* ID must be a value between 1 and 8.<br>
* Default value: 0
*/
setMaxiCodeStructuredAppendModeBarcodeId(maxiCodeStructuredAppendModeBarcodeId)
{
this.getJavaClass().setMaxiCodeStructuredAppendModeBarcodeIdSync(maxiCodeStructuredAppendModeBarcodeId);
}
/**
* Gets a MaxiCode barcodes count in structured append mode.<br>
* Count number must be a value between 2 and 8 (maximum barcodes count).<br>
* Default value: -1
*/
getMaxiCodeStructuredAppendModeBarcodesCount()
{
return this.getJavaClass().getMaxiCodeStructuredAppendModeBarcodesCountSync();
}
/**
* Sets a MaxiCode barcodes count in structured append mode.<br>
* Count number must be a value between 2 and 8 (maximum barcodes count).<br>
* Default value: -1
*/
setMaxiCodeStructuredAppendModeBarcodesCount(maxiCodeStructuredAppendModeBarcodesCount)
{
this.getJavaClass().setMaxiCodeStructuredAppendModeBarcodesCountSync(maxiCodeStructuredAppendModeBarcodesCount);
}
/**
* Height/Width ratio of 2D BarCode module.
*/
getAspectRatio()
{
return this.getJavaClass().getAspectRatioSync();
}
/**
* Height/Width ratio of 2D BarCode module.
*/
setAspectRatio(value)
{
this.getJavaClass().setAspectRatioSync(java.newFloat(value));
}
/**
* Returns a human-readable string representation of this MaxiCodeParameters.<br>
* @return A string that represents this MaxiCodeParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* Aztec parameters.
*/
class AztecParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* <p>
* Gets a Aztec encode mode.
* Default value: Auto.
* </p>
*/
getAztecEncodeMode()
{
return this.getJavaClass().getAztecEncodeModeSync();
}
/**
* <p>
* Sets a Aztec encode mode.
* Default value: Auto.
* </p>
*/
setAztecEncodeMode(value)
{
this.getJavaClass().setAztecEncodeModeSync(value);
}
/**
* <p>
* Gets ECI encoding. Used when AztecEncodeMode is Auto.
* Default value: ISO-8859-1
* </p>
*/
getECIEncoding()
{
return this.getJavaClass().getECIEncodingSync();
}
/**
* <p>
* Sets ECI encoding. Used when AztecEncodeMode is Auto.
* Default value: ISO-8859-1
* </p>
*/
setECIEncoding(value)
{
this.getJavaClass().setECIEncodingSync(value);
}
/**
* <p>
* Barcode ID for Structured Append mode of Aztec barcode. Barcode ID should be in range from 1 to barcodes count.
* Default value: 0
* </p>
*/
getStructuredAppendBarcodeId()
{
return this.getJavaClass().getStructuredAppendBarcodeIdSync();
}
/**
* <p>
* Barcode ID for Structured Append mode of Aztec barcode. Barcode ID should be in range from 1 to barcodes count.
* Default value: 0
* </p>
*/
setStructuredAppendBarcodeId(value)
{
this.getJavaClass().setStructuredAppendBarcodeIdSync(value);
}
/**
* <p>
* Barcodes count for Structured Append mode of Aztec barcode. Barcodes count should be in range from 1 to 26.
* Default value: 0
* </p>
*/
getStructuredAppendBarcodesCount()
{
return this.getJavaClass().getStructuredAppendBarcodesCountSync();
}
/**
* <p>
* Barcodes count for Structured Append mode of Aztec barcode. Barcodes count should be in range from 1 to 26.
* Default value: 0
* </p>
*/
setStructuredAppendBarcodesCount(value)
{
this.getJavaClass().setStructuredAppendBarcodesCountSync(value);
}
/**
* <p>
* File ID for Structured Append mode of Aztec barcode (optional field). File ID should not contain spaces.
* Default value: empty string
* </p>
*/
getStructuredAppendFileId()
{
return this.getJavaClass().getStructuredAppendFileIdSync();
}
/**
* <p>
* File ID for Structured Append mode of Aztec barcode (optional field). File ID should not contain spaces.
* Default value: empty string
* </p>
*/
setStructuredAppendFileId(value)
{
this.getJavaClass().setStructuredAppendFileIdSync(value);
}
/**
* <p>
* Level of error correction of Aztec types of barcode.
* Value should between 5 to 95.
* </p>
*/
getAztecErrorLevel()
{
return this.getJavaClass().getAztecErrorLevelSync();
}
/**
* <p>
* Level of error correction of Aztec types of barcode.
* Value should between 5 to 95.
* </p>
*/
setAztecErrorLevel(value)
{
this.getJavaClass().setAztecErrorLevelSync(value);
}
/**
* <p>
* Gets a Aztec Symbol mode.
* Default value: AztecSymbolMode.Auto.
* </p>
*/
getAztecSymbolMode()
{
return this.getJavaClass().getAztecSymbolModeSync();
}
/**
* <p>
* Sets a Aztec Symbol mode.
* Default value: AztecSymbolMode.Auto.
* </p>
*/
setAztecSymbolMode(value)
{
this.getJavaClass().setAztecSymbolModeSync(value);
}
/**
* <p>
* Gets layers count of Aztec symbol. Layers count should be in range from 1 to 3 for Compact mode and
* in range from 1 to 32 for Full Range mode.
* Default value: 0 (auto).
* </p>
*/
getLayersCount()
{
return this.getJavaClass().getLayersCountSync();
}
/**
* <p>
* Sets layers count of Aztec symbol. Layers count should be in range from 1 to 3 for Compact mode and
* in range from 1 to 32 for Full Range mode.
* Default value: 0 (auto).
* </p>
*/
setLayersCount(value)
{
this.getJavaClass().setLayersCountSync(value);
}
/**
* <p>
* Used to instruct the reader to interpret the data contained within the symbol
* as programming for reader initialization.
* </p>
*/
isReaderInitialization()
{
return this.getJavaClass().isReaderInitializationSync();
}
/**
* <p>
* Used to instruct the reader to interpret the data contained within the symbol
* as programming for reader initialization.
* </p>
*/
setReaderInitialization(value)
{
this.getJavaClass().setReaderInitializationSync(value);
}
/**
* <p>
* Height/Width ratio of 2D BarCode module.
* </p>
*/
getAspectRatio()
{
return this.getJavaClass().getAspectRatioSync();
}
/**
* <p>
* Height/Width ratio of 2D BarCode module.
* </p>
*/
setAspectRatio(value)
{
this.getJavaClass().setAspectRatioSync(java.newFloat(value));
}
/**
* <p>
* Returns a human-readable string representation of this {@code AztecParameters}.
* </p>
* @return A string that represents this {@code AztecParameters}.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* Codabar parameters.
*/
class CodabarParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* Get the checksum algorithm for Codabar barcodes.<br>
* Default value: CodabarChecksumMode.MOD_16.<br>
* To enable checksum calculation set value EnableChecksum.YES to property EnableChecksum.<br>
* See CodabarChecksumMode.
*/
getCodabarChecksumMode()
{
return this.getJavaClass().getCodabarChecksumModeSync();
}
/**
* Set the checksum algorithm for Codabar barcodes.<br>
* Default value: CodabarChecksumMode.MOD_16.<br>
* To enable checksum calculation set value EnableChecksum.YES to property EnableChecksum.<br>
* See CodabarChecksumMode.
*/
setCodabarChecksumMode(value)
{
this.getJavaClass().setCodabarChecksumModeSync(value);
}
/**
* Start symbol (character) of Codabar symbology.<br>
* Default value: CodabarSymbol.A
*/
getCodabarStartSymbol()
{
return this.getJavaClass().getCodabarStartSymbolSync();
}
/**
* Start symbol (character) of Codabar symbology.<br>
* Default value: CodabarSymbol.A
*/
setCodabarStartSymbol(value)
{
this.getJavaClass().setCodabarStartSymbolSync(value);
}
/**
* Stop symbol (character) of Codabar symbology.<br>
* Default value: CodabarSymbol.A
*/
getCodabarStopSymbol()
{
return this.getJavaClass().getCodabarStopSymbolSync();
}
/**
* Stop symbol (character) of Codabar symbology.<br>
* Default value: CodabarSymbol.A
*/
setCodabarStopSymbol(value)
{
this.getJavaClass().setCodabarStopSymbolSync(value);
}
/**
* Returns a human-readable string representation of this CodabarParameters.<br>
* @return A string that represents this CodabarParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* Coupon parameters. Used for UpcaGs1DatabarCoupon, UpcaGs1Code128Coupon.
*/
class CouponParameters extends joint.BaseJavaClass
{
_space;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this._space = new Unit(this.getJavaClass().getSupplementSpaceSync());
}
/**
* Space between main the BarCode and supplement BarCode in Unit value.<br>
* @exception IllegalArgumentException<br>
* The Space parameter value is less than 0.
*/
getSupplementSpace()
{
return this._space;
}
/**
* Space between main the BarCode and supplement BarCode in Unit value.<br>
* @exception IllegalArgumentException<br>
* The Space parameter value is less than 0.
*/
setSupplementSpace(value)
{
this.getJavaClass().setSupplementSpaceSync(value.getJavaClass());
this._space = value;
}
/**
* Returns a human-readable string representation of this CouponParameters.<br>
* @return A string that represents this CouponParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* Defines a particular format for text, including font face, size, and style attributes<br>
* where size in Unit value property.<br>
* @example
* This sample shows how to create and save a BarCode image.
*
* let generator = new BarcodeGenerator(EncodeTypes.CODE_128);
* generator.getParameters().getCaptionAbove().setText("CAPTION ABOOVE");
* generator.getParameters().getCaptionAbove().setVisible(true);
* generator.getParameters().getCaptionAbove().getFont().setStyle(FontStyle.ITALIC);
* generator.getParameters().getCaptionAbove().getFont().getSize().setPoint(25);
*/
class FontUnit extends joint.BaseJavaClass
{
_size;
constructor(source)
{
super(FontUnit.initFontUnit(source));
this.init();
}
static initFontUnit(source)
{
if (source instanceof FontUnit) {
return source.getJavaClass();
}
return source;
}
init()
{
this._size = new Unit(this.getJavaClass().getSizeSync());
}
/**
* Gets the face name of this Font.
*/
getFamilyName()
{
return this.getJavaClass().getFamilyNameSync();
}
/**
* Sets the face name of this Font.
*/
setFamilyName(value)
{
this.getJavaClass().setFamilyNameSync(value);
}
/**
* Gets style information for this FontUnit.
*/
getStyle()
{
return this.getJavaClass().getStyleSync();
}
/**
* Sets style information for this FontUnit.
*/
setStyle(value)
{
if (!("number" === typeof value)) {
value = parseInt(value, 10);
}
this.getJavaClass().setStyleSync(value);
}
/**
* Gets size of this FontUnit in Unit value.<br>
* @exception IllegalArgumentException<br>
* The Size parameter value is less than or equal to 0.
*/
getSize()
{
return this._size;
}
}
/**
* Helper class for automatic codetext generation of the Extended Codetext Mode
*/
class ExtCodetextBuilder extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
/**
* <p>
* Clears extended codetext items
* </p>
*/
clear()
{
this.getJavaClass().clearSync();
}
/**
* <p>
* Adds plain codetext to the extended codetext items
* </p>
*
* @param codetext Codetext in unicode to add as extended codetext item
*/
addPlainCodetext(codetext)
{
this.getJavaClass().addPlainCodetextSync(codetext);
}
/**
* <p>
* Adds codetext with Extended Channel Identifier
* </p>
*
* @param ECIEncoding Extended Channel Identifier
* @param codetext Codetext in unicode to add as extended codetext item with Extended Channel Identifier
*/
addECICodetext(ECIEncoding, codetext)
{
this.getJavaClass().addECICodetextSync(ECIEncoding, codetext);
}
/**
* <p>
* Generate extended codetext from generation items list
* </p>
*
* @return Return string of extended codetext
*/
getExtendedCodetext()
{
return this.getJavaClass().getExtendedCodetextSync();
}
}
/**
* <p>Extended codetext generator for 2D QR barcodes for ExtendedCodetext Mode of QREncodeMode</p>
* <p>Use Display2DText property of BarCodeBuilder to set visible text to removing managing characters.</p>
* @example
* //Example how to generate FNC1 first position for Extended Mode
* //create codetext
* QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();
* lTextBuilder.addFNC1FirstPosition();
* lTextBuilder.addPlainCodetext("000%89%%0");
* lTextBuilder.addFNC1GroupSeparator();
* lTextBuilder.addPlainCodetext("12345<FNC1>");
* //generate codetext
* String lCodetext = lTextBuilder.getExtendedCodetext();
*
* @example
* //Example how to generate FNC1 second position for Extended Mode
* //create codetext
* QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();
* lTextBuilder.addFNC1SecondPosition("12");
* lTextBuilder.addPlainCodetext("TRUE3456");
* //generate codetext
* String lCodetext = lTextBuilder.getExtendedCodetext();
*
* @example
* //Example how to generate multi ECI mode for Extended Mode
* //create codetext
* QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();
* lTextBuilder.addECICodetext(ECIEncodings.Win1251, "Will");
* lTextBuilder.addECICodetext(ECIEncodings.UTF8, "Right");
* lTextBuilder.addECICodetext(ECIEncodings.UTF16BE, "Power");
* lTextBuilder.addPlainCodetext("t\\e\\\\st");
* //generate codetext
* String lCodetext = lTextBuilder.getExtendedCodetext();
*/
class QrExtCodetextBuilder extends ExtCodetextBuilder
{
static get javaClassName()
{
return "com.aspose.mw.barcode.MwQrExtCodetextBuilder";
}
constructor()
{
let java_class = java.import(QrExtCodetextBuilder.javaClassName);
super(new java_class());
this.init();
}
init()
{
}
/**
* <p>
* Adds FNC1 in first position to the extended codetext items
* </p>
*/
addFNC1FirstPosition()
{
this.getJavaClass().addFNC1FirstPositionSync();
}
/**
* <p>
* Adds FNC1 in second position to the extended codetext items
* </p>
*
* @param codetext Value of the FNC1 in the second position
*/
addFNC1SecondPosition(codetext)
{
this.getJavaClass().addFNC1SecondPositionSync(codetext);
}
/**
* <p>
* Adds Group Separator (GS - '\\u001D') to the extended codetext items
* </p>
*/
addFNC1GroupSeparator()
{
this.getJavaClass().addFNC1GroupSeparatorSync();
}
/**
* <p>
* Generates Extended codetext from the extended codetext list.
* </p>
*
* @return Extended codetext as string
*/
getExtendedCodetext()
{
return this.getJavaClass().getExtendedCodetextSync();
}
}
/**
* QR structured append parameters.
*/
class QrStructuredAppendParameters extends joint.BaseJavaClass
{
init()
{
}
constructor(javaClass)
{
super(javaClass);
this.init();
}
/**
* Gets the QR structured append mode parity data.
*/
getParityByte()
{
return this.getJavaClass().getParityByteSync();
}
/**
* Sets the QR structured append mode parity data.
*/
setParityByte(value)
{
this.getJavaClass().setParityByteSync(value);
}
/**
* Gets the index of the QR structured append mode barcode. Index starts from 0.
*/
getSequenceIndicator()
{
return this.getJavaClass().getSequenceIndicatorSync();
}
/**
* Sets the index of the QR structured append mode barcode. Index starts from 0.
*/
setSequenceIndicator(value)
{
this.getJavaClass().setSequenceIndicatorSync(value);
}
/**
* Gets the QR structured append mode barcodes quantity. Max value is 16.
*/
getTotalCount()
{
return this.getJavaClass().getTotalCountSync();
}
/**
* Sets the QR structured append mode barcodes quantity. Max value is 16.
*/
setTotalCount(value)
{
this.getJavaClass().setTotalCountSync(value);
}
}
/**
* Extended codetext generator for MaxiCode barcodes for ExtendedCodetext Mode of MaxiCodeEncodeMode
* Use TwoDDisplayText property of BarcodeGenerator to set visible text to removing managing characters.
*
* This sample shows how to use MaxiCodeExtCodetextBuilder in Extended Mode.
*
* @example
* //create codetext
* let textBuilder = new MaxiCodeExtCodetextBuilder();
* textBuilder.addECICodetext(ECIEncodings.Win1251, "Will");
* textBuilder.addECICodetext(ECIEncodings.UTF8, "犬Right狗");
* textBuilder.addECICodetext(ECIEncodings.UTF16BE, "犬Power狗");
* textBuilder.addPlainCodetext("Plain text");
*
* //generate codetext
* let codetext = textBuilder.getExtendedCodetext();
*
* //generate
* let generator = new BarcodeGenerator(EncodeTypes.MAXI_CODE, codetext);
* generator.getParameters().getBarcode().getCodeTextParameters().setTwoDDisplayText("My Text");
* generator.save("test.bmp", BarcodeImageFormat.BMP);
*/
class MaxiCodeExtCodetextBuilder extends ExtCodetextBuilder
{
static JAVA_CLASS_NAME = "com.aspose.mw.barcode.generation.MwMaxiCodeExtCodetextBuilder";
constructor()
{
try {
let java_class = java.import(MaxiCodeExtCodetextBuilder.JAVA_CLASS_NAME);
super(new java_class());
} catch (ex) {
throw new joint.BarcodeException(ex.getMessage(), __FILE__, __LINE__);
}
}
init()
{
}
/**
* Generates Extended codetext from the extended codetext list.
* @return Extended codetext as string
*/
getExtendedCodetext()
{
return this.getJavaClass().getExtendedCodetextSync();
}
}
/**
* <p>
* Extended codetext generator for 2D DotCode barcodes for ExtendedCodetext Mode of DotCodeEncodeMode
* </p>
* @example
* //Extended codetext mode
* //create codetext
* let textBuilder = new DotCodeExtCodetextBuilder();
* textBuilder.addFNC1FormatIdentifier();
* textBuilder.addECICodetext(ECIEncodings.Win1251, "Will");
* textBuilder.addFNC1FormatIdentifier();
* textBuilder.addECICodetext(ECIEncodings.UTF8, "犬Right狗");
* textBuilder.addFNC1FormatIdentifier();
* textBuilder.addECICodetext(ECIEncodings.UTF16BE, "犬Power狗");
* textBuilder.addPlainCodetext("Plain text");
* textBuilder.addFNC3SymbolSeparator();
* textBuilder.addFNC3ReaderInitialization();
* textBuilder.addPlainCodetext("Reader initialization info");
* //generate codetext
* let codetext = textBuilder.getExtendedCodetext();
* //generate
* let generator = new BarcodeGenerator(EncodeTypes.DOT_CODE, codetext);
* generator.getParameters().getBarcode().getDotCode().setDotCodeEncodeMode(DotCodeEncodeMode.EXTENDED_CODETEXT);
* generator.save("test.bmp", BarCodeImageFormat.BMP);
*/
class DotCodeExtCodetextBuilder extends ExtCodetextBuilder
{
static JAVA_CLASS_NAME = "com.aspose.mw.barcode.generation.MwDotCodeExtCodetextBuilder";
constructor()
{
let java_class_link = java.import(DotCodeExtCodetextBuilder.JAVA_CLASS_NAME);
let javaClass = new java_class_link();
super(javaClass);
}
init()
{
}
/**
* <p>
* Adds FNC1 format identifier to the extended codetext items
* </p>
*/
addFNC1FormatIdentifier()
{
this.getJavaClass().addFNC1FormatIdentifierSync();
}
/**
* <p>
* Adds FNC3 symbol separator to the extended codetext items
* </p>
*/
addFNC3SymbolSeparator()
{
this.getJavaClass().addFNC3SymbolSeparatorSync();
}
/**
* <p>
* Adds FNC3 reader initialization to the extended codetext items
* </p>
*/
addFNC3ReaderInitialization()
{
this.getJavaClass().addFNC3ReaderInitializationSync();
}
/**
* <p>
* Adds structured append mode to the extended codetext items
* </p>
* @param barcodeId ID of barcode
* @param barcodesCount Barcodes count
*/
addStructuredAppendMode(barcodeId, barcodesCount)
{
this.getJavaClass().addStructuredAppendModeSync(barcodeId, barcodesCount);
}
/**
* <p>
* Generates Extended codetext from the extended codetext list.
* </p>
* @return Extended codetext as string
*/
getExtendedCodetext()
{
return this.getJavaClass().getExtendedCodetextSync();
}
}
/**
* Code128 parameters.
*/
class Code128Parameters extends joint.BaseJavaClass
{
init()
{
}
constructor(javaClass)
{
super(javaClass);
this.init();
}
/**
* <p>
* Gets a Code128 encode mode.
* Default value: Code128EncodeMode.Auto
* </p>
*/
getCode128EncodeMode()
{
return this.getJavaClass().getCode128EncodeModeSync();
}
/**
* <p>
* Sets a Code128 encode mode.
* Default value: Code128EncodeMode.Auto
* </p>
*/
setCode128EncodeMode(value)
{
this.getJavaClass().setCode128EncodeModeSync(value);
}
/**
* Returns a human-readable string representation of this PatchCodeParameters.
* @return string A string that represents this PatchCodeParameters.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* <p>
* Han Xin parameters.
* </p>
*/
class HanXinParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* <p>
* Version of HanXin Code.
* From Version01 to Version84 for Han Xin code.
* Default value is HanXinVersion.Auto.
* </p>
*/
getHanXinVersion()
{
return this.getJavaClass().getHanXinVersionSync();
}
/**
* <p>
* Version of HanXin Code.
* From Version01 to Version84 for Han Xin code.
* Default value is HanXinVersion.Auto.
* </p>
*/
setHanXinVersion(value)
{
this.getJavaClass().setHanXinVersionSync(value);
}
/**
* <p>
* Level of Reed-Solomon error correction for Han Xin barcode.
* From low to high: L1, L2, L3, L4. see HanXinErrorLevel.
* </p>
*/
getHanXinErrorLevel()
{
return this.getJavaClass().getHanXinErrorLevelSync();
}
/**
* <p>
* Level of Reed-Solomon error correction for Han Xin barcode.
* From low to high: L1, L2, L3, L4. see HanXinErrorLevel.
* </p>
*/
setHanXinErrorLevel(value)
{
this.getJavaClass().setHanXinErrorLevelSync(value);
}
/**
* <p>
* HanXin encoding mode.
* Default value: HanXinEncodeMode.Mixed.
* </p>
*/
getHanXinEncodeMode()
{
return this.getJavaClass().getHanXinEncodeModeSync();
}
/**
* <p>
* HanXin encoding mode.
* Default value: HanXinEncodeMode.Mixed.
* </p>
*/
setHanXinEncodeMode(value)
{
this.getJavaClass().setHanXinEncodeModeSync(value);
}
/**
* <p>
* Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details
* about the used references for encoding the data in the symbol.
* Current implementation consists all well known charset encodings.
* </p>
*/
getHanXinECIEncoding()
{
return this.getJavaClass().getHanXinECIEncodingSync();
}
/**
* <p>
* Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details
* about the used references for encoding the data in the symbol.
* Current implementation consists all well known charset encodings.
* </p>
*/
setHanXinECIEncoding(value)
{
this.getJavaClass().setHanXinECIEncodingSync(value);
}
/**
* <p>
* Returns a human-readable string representation of this {@code HanXinParameters}.
* </p>
* @return A string that represents this {@code HanXinParameters}.
*/
toString()
{
return this.getJavaClass().toStringSync();
}
}
/**
* <p>
* <p>Extended codetext generator for 2D DataMatrix barcodes for ExtendedCodetext Mode of DataMatrixEncodeMode</p>
* </p><p><hr><blockquote><pre>
* <pre>
* //Extended codetext mode
* //create codetext
* let textBuilder = new DataMatrixExtCodetextBuilder();
* codetextBuilder.addECICodetextWithEncodeMode(ECIEncodings.Win1251, DataMatrixEncodeMode.BYTES, "World");
* codetextBuilder.addPlainCodetext("Will");
* codetextBuilder.addECICodetext(ECIEncodings.UTF_8, "犬Right狗");
* codetextBuilder.addCodetextWithEncodeMode(DataMatrixEncodeMode.C_40, "ABCDE");
* //generate codetext
* let codetext = textBuilder.getExtendedCodetext();
* //generate
* let generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX, null, codetext);
* generator.getParameters().getBarcode().getDataMatrix().setDataMatrixEncodeMode(DataMatrixEncodeMode.EXTENDED_CODETEXT);
* generator.save("test.bmp", BarcodeImageFormat.BMP);
* </pre>
* </pre>
* </pre></blockquote></hr></p>
*/
class DataMatrixExtCodetextBuilder extends ExtCodetextBuilder
{
static JAVA_CLASS_NAME = "com.aspose.mw.barcode.generation.MwDataMatrixExtCodetextBuilder";
constructor()
{
let java_class_link = java.import(DataMatrixExtCodetextBuilder.JAVA_CLASS_NAME);
let javaClass = new java_class_link();
super(javaClass);
}
static construct(javaClass)
{
let obj = new DataMatrixExtCodetextBuilder();
obj.setJavaClass(javaClass);
return obj;
}
init()
{
}
/**
* <p>
* Adds codetext with Extended Channel Identifier with defined encode mode
* </p>
* @param ECIEncoding Extended Channel Identifier
* @param encodeMode Encode mode value
* @param codetext Codetext in unicode to add as extended codetext item with Extended Channel Identifier with defined encode mode
*/
addECICodetextWithEncodeMode(ECIEncoding, encodeMode, codetext)
{
this.getJavaClass().addECICodetextWithEncodeModeSync(ECIEncoding, encodeMode, codetext);
}
/**
* <p>
* Adds codetext with defined encode mode to the extended codetext items
* </p>
* @param encodeMode Encode mode value
* @param codetext Codetext in unicode to add as extended codetext item
*/
addCodetextWithEncodeMode(encodeMode, codetext)
{
this.getJavaClass().addCodetextWithEncodeModeSync(encodeMode, codetext);
}
/**
* <p>
* Generates Extended codetext from the extended codetext list.
* </p>
* @return Extended codetext as string
*/
getExtendedCodetext()
{
return this.getJavaClass().getExtendedCodetextSync();
}
}
/**
* <p>
* <p>Extended codetext generator for Han Xin Code for Extended Mode of HanXinEncodeMode</p>
* </p><p><hr><blockquote><pre>
* <pre>
*
* //Extended codetext mode
* //create codetext
* let codeTextBuilder = new HanXinExtCodetextBuilder();
* codeTextBuilder.addGB18030TwoByte("漄");
* codeTextBuilder.addGB18030FourByte("㐁");
* codeTextBuilder.addCommonChineseRegionOne("全");
* codeTextBuilder.addCommonChineseRegionTwo("螅");
* codeTextBuilder.addNumeric("123");
* codeTextBuilder.addText("qwe");
* codeTextBuilder.addUnicode("ıntəˈnæʃənəl");
* codeTextBuilder.addECI("ΑΒΓΔΕ", 9);
* codeTextBuilder.addAuto("abc");
* codeTextBuilder.addBinary("abc");
* codeTextBuilder.addURI("backslashes_should_be_doubled\000555:test");
* codeTextBuilder.addGS1("(01)03453120000011(17)191125(10)ABCD1234(21)10");
* let expectedStr = "漄㐁全螅123qweıntəˈnæʃənəlΑΒΓΔΕabcabcbackslashes_should_be_doubled\000555:test(01)03453120000011(17)191125(10)ABCD1234(21)10";
* //generate codetext
* let str = codeTextBuilder.getExtendedCodetext();
* //generate
* let bg = new BarcodeGenerator(EncodeTypes.HAN_XIN, str);
* bg.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(HanXinEncodeMode.EXTENDED);
* let img = bg.generateBarCodeImage(BarcodeImageFormat.PNG);
* let r = new BarCodeReader(img, null, DecodeType.HAN_XIN))
* let found = r.readBarCodes();
* assert.assertEquals(1, found.length);
* assert.assertEquals(expectedStr, found[0].getCodeText());
* </pre>
* </pre></blockquote></hr></p>
*/
class HanXinExtCodetextBuilder extends joint.BaseJavaClass
{
static JAVA_CLASS_NAME = "com.aspose.mw.barcode.generation.MwHanXinExtCodetextBuilder";
constructor()
{
let java_class_link = java.import(HanXinExtCodetextBuilder.JAVA_CLASS_NAME);
let javaClass = new java_class_link();
super(javaClass);
}
init()
{
}
/**
* <p>
* Adds codetext fragment in ECI mode
* </p>
* @param text Codetext string
* @param encoding ECI encoding in number format
*/
addECI(text, encoding)
{
this.getJavaClass().addECISync(text, encoding);
}
/**
* <p>
* Adds codetext fragment in Auto mode
* </p>
* @param text Codetext string
*/
addAuto(text)
{
this.getJavaClass().addAutoSync(text);
}
/**
* <p>
* Adds codetext fragment in Binary mode
* </p>
* @param text Codetext string
*/
addBinary(text)
{
this.getJavaClass().addBinarySync(text);
}
/**
* <p>
* Adds codetext fragment in URI mode
* </p>
* @param text Codetext string
*/
addURI(text)
{
this.getJavaClass().addURISync(text);
}
/**
* <p>
* Adds codetext fragment in Text mode
* </p>
* @param text Codetext string
*/
addText(text)
{
this.getJavaClass().addTextSync(text);
}
/**
* <p>
* Adds codetext fragment in Numeric mode
* </p>
* @param text Codetext string
*/
addNumeric(text)
{
this.getJavaClass().addNumericSync(text);
}
/**
* <p>
* Adds codetext fragment in Unicode mode
* </p>
* @param text Codetext string
*/
addUnicode(text)
{
this.getJavaClass().addUnicodeSync(text);
}
/**
* <p>
* Adds codetext fragment in Common Chinese Region One mode
* </p>
* @param text Codetext string
*/
addCommonChineseRegionOne(text)
{
this.getJavaClass().addCommonChineseRegionOneSync(text);
}
/**
* <p>
* Adds codetext fragment in Common Chinese Region Two mode
* </p>
* @param text Codetext string
*/
addCommonChineseRegionTwo(text)
{
this.getJavaClass().addCommonChineseRegionTwoSync(text);
}
/**
* <p>
* Adds codetext fragment in GB18030 Two Byte mode
* </p>
* @param text Codetext string
*/
addGB18030TwoByte(text)
{
this.getJavaClass().addGB18030TwoByteSync(text);
}
/**
* <p>
* Adds codetext fragment in GB18030 Four Byte mode
* </p>
* @param text Codetext string
*/
addGB18030FourByte(text)
{
this.getJavaClass().addGB18030FourByteSync(text);
}
/**
* <p>
* Adds codetext fragment in GS1 mode
* </p>
* @param text Codetext string
*/
addGS1(text)
{
this.getJavaClass().addGS1Sync(text);
}
/**
* <p>
* Returns codetext from Extended mode codetext builder
* </p>
* @return Codetext in Extended mode
*/
getExtendedCodetext()
{
return this.getJavaClass().getExtendedCodetextSync();
}
}
/**
* Image parameters.
*/
class ImageParameters extends joint.BaseJavaClass
{
svg;
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
this.svg = new SvgParameters(this.getJavaClass().getSvgSync());
}
/**
* SVG parameters
*/
getSvg()
{
return this.svg;
}
/**
* SVG parameters
*/
setSvg(svg)
{
this.svg = svg;
this.getJavaClass().setSvgSync(svg.getJavaClass());
}
}
/**
* SVG parameters.
*/
class SvgParameters extends joint.BaseJavaClass
{
constructor(javaClass)
{
super(javaClass);
this.init();
}
init()
{
}
/**
* Does SVG image contain explicit size in pixels (recommended)
* Default value: true.
*/
isExplicitSizeInPixels()
{
return this.getJavaClass().isExplicitSizeInPixelsSync();
}
/**
* Does SVG image contain explicit size in pixels (recommended)
* Default value: true.
*/
setExplicitSizeInPixels(explicitSizeInPixels)
{
this.getJavaClass().setExplicitSizeInPixelsSync(explicitSizeInPixels);
}
/**
* Does SVG image contain text as text element rather than paths (recommended)
* Default value: true.
*/
isTextDrawnInTextElement()
{
return this.getJavaClass().isTextDrawnInTextElementSync();
}
/**
* Does SVG image contain text as text element rather than paths (recommended)
* Default value: true.
*/
setTextDrawnInTextElement(textDrawnInTextElement)
{
this.getJavaClass().setTextDrawnInTextElementSync(textDrawnInTextElement);
}
/**
* <p>
* Possible modes for filling color in svg file, RGB is default and supported by SVG 1.1.
* RGBA, HSL, HSLA is allowed in SVG 2.0 standard.
* Even in RGB opacity will be set through "fill-opacity" parameter
* </p>
*/
setSvgColorMode(svgColorMode)
{
this.getJavaClass().setSvgColorModeSync(svgColorMode);
}
/**
* Possible modes for filling color in svg file, RGB is default and supported by SVG 1.1.
* RGBA, HSL, HSLA is allowed in SVG 2.0 standard.
* Even in RGB opacity will be set through "fill-opacity" parameter
*/
getSvgColorMode()
{
return this.getJavaClass().getSvgColorModeSync();
}
}
/**
* <p>
* Class for representing HSLA color (Hue, Saturation, Lightness, Alpha)
* </p>
*/
class HslaColor
{
/**
* <p>
* Hue [0, 360]
* </p>
*/
H;
/**
* <p>
* Saturation [0, 100]
* </p>
*/
S;
/**
* <p>
* Lightness [0, 100]
* </p>
*/
L;
/**
* <p>
* Alpha (opacity) [0.0f, 1.0f]
* </p>
*/
A = 0.0;
/**
* <p>
* Constructor for HslaColor
* </p>
*
* @param h Hue [0, 360]
* @param s Saturation [0, 100]
* @param l Lightness [0, 100]
* @param a Alpha (opacity) [0.0f, 1.0f]
*/
constructor(h, s, l, a)
{
HslaColor.checkHue(h);
HslaColor.checkSatLight(s);
HslaColor.checkSatLight(l);
HslaColor.checkAlpha(a);
this.H = h;
this.S = s;
this.L = l;
this.A = a;
}
static checkHue(value)
{
if (value < 0 || value > 360) {
throw new Exception("Wrong color value");
}
}
static checkSatLight(value)
{
if (value < 0 || value > 100) {
throw new Exception("Wrong color value");
}
}
static checkAlpha(value)
{
if (value < 0.0 || value > 1.0) {
throw new Exception("Wrong color value");
}
}
/**
* <p>
* Uses https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB
* </p>
*
* @param hslaColor HSLA color to convert
* @return string with RGBA values
*/
static convertHslaToRgba(hslaColor) {
let r = 0, g = 0, b = 0;
let hueF = hslaColor.H / 360.0;
let satF = hslaColor.S / 100.0;
let lightF = hslaColor.L / 100.0;
if (satF === 0) {
r = g = b = lightF;
} else {
let q = lightF < 0.5 ? lightF * (1 + satF) : lightF + satF - lightF * satF;
let p = 2 * lightF - q;
r = HslaColor.hueToRgb(p, q, hueF + 1.0 / 3.0);
g = HslaColor.hueToRgb(p, q, hueF);
b = HslaColor.hueToRgb(p, q, hueF - 1.0 / 3.0);
}
let rI = Math.floor(r * 255 + 0.5);
let gI = Math.floor(g * 255 + 0.5);
let bI = Math.floor(b * 255 + 0.5);
let aI = Math.floor(hslaColor.A * 255 + 0.5);
return `#${rI.toString(16).padStart(2, '0')}${gI.toString(16).padStart(2, '0')}${bI.toString(16).padStart(2, '0')}${aI.toString(16).padStart(2, '0')}`.toUpperCase();
}
static hueToRgb(p, q, t) {
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1 / 6) return p + (q - p) * 6 * t;
if (t < 1 / 2) return q;
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
return p;
}
}
/**
* BarcodeClassifications EncodeTypes classification
* @enum
*/
BarcodeClassifications =
{
/**
* Unspecified classification
*/
NONE: 0,
/**
* Specifies 1D-barcode
*/
TYPE_1D: 1,
/**
* Specifies 2D-barcode
*/
TYPE_2D: 2,
/**
* Specifies POSTAL-barcode
*/
POSTAL: 3,
/**
* Specifies DataBar-barcode
*/
DATABAR: 4,
/**
* Specifies COUPON-barcode
*/
COUPON: 5
};
/**
* FontStyle classification
* @enum
*/
FontStyle =
{
/**
* Bold text
*/
BOLD: 1,
/**
* Italic text
*/
ITALIC: 2,
/**
* Normal text
*/
REGULAR: 0,
/**
* Text with a line through the middle.
*/
STRIKEOUT: 8,
/**
* Underlined text.
*/
UNDERLINE: 4
};
/**
* Specifies the start or stop symbol of the Codabar barcode specification.
* @enum
*/
CodabarSymbol =
{
/**
* Specifies character A as the start or stop symbol of the Codabar barcode specification.
*/
A: 65,
/**
* Specifies character B as the start or stop symbol of the Codabar barcode specification.
*/
B: 66,
/**
* Specifies character C as the start or stop symbol of the Codabar barcode specification.
*/
C: 67,
/**
* Specifies character D as the start or stop symbol of the Codabar barcode specification.
*/
D: 68,
};
/**
* <p>
* DataMatrix encoder's encoding mode, default to Auto
* </p><p><hr><blockquote><pre>
* This sample shows how to do codetext in Extended Mode.
* <pre>
* //Auto mode
* let codetext = "犬Right狗";
* let generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX, codetext);
* generator.getParameters().getBarcode().getDataMatrix().setECIEncoding(ECIEncodings.UTF8);
* generator.save("test.bmp", BarcodeImageFormat.PNG);
* //Bytes mode
* let encodedArr = [ 0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9 ];
* let generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX, encodedArr);
* generator.getParameters().getBarcode().getDataMatrix().setDataMatrixEncodeMode(DataMatrixEncodeMode.BINARY);
* generator.save("test.bmp", BarcodeImageFormat.PNG);
* //Extended codetext mode
* //create codetext
* let codetextBuilder=new DataMatrixExtCodetextBuilder();
* codetextBuilder.addECICodetextWithEncodeMode(ECIEncodings.Win1251,DataMatrixEncodeMode.BYTES,"World");
* codetextBuilder.addPlainCodetext("Will");
* codetextBuilder.addECICodetext(ECIEncodings.UTF8,"犬Right狗");
* codetextBuilder.addCodetextWithEncodeMode(DataMatrixEncodeMode.C40,"ABCDE");
* //generate codetext
* let codetext=codetextBuilder.getExtended();
* //generate
* let generator=new BarcodeGenerator(EncodeTypes.DATA_MATRIX,codetext);
* generator.getParameters().getBarcode().getDataMatrix().setDataMatrixEncodeMode(DataMatrixEncodeMode.EXTENDED_CODETEXT);
* generator.save("test.bmp", BarcodeImageFormat.PNG);
* </pre>
* </pre></blockquote></hr></p>
*/
DataMatrixEncodeMode =
{
/**
* In Auto mode, the CodeText is encoded with maximum data compactness.
* Unicode characters are re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
* If a character is found that is not supported by the selected ECI encoding, an exception is thrown.
*/
AUTO: 0,
/**
* Encodes one alphanumeric or two numeric characters per byte
*/
ASCII: 1,
/**
* Encode 8 bit values
* @deprecated This property is obsolete and will be removed in future releases. Instead, use Base256 option.
*/
BYTES: 6,
/**
* Uses C40 encoding. Encodes Upper-case alphanumeric, Lower case and special characters
*/
C40: 8,
/**
* Uses Text encoding. Encodes Lower-case alphanumeric, Upper case and special characters
*/
TEXT: 9,
/**
* Uses EDIFACT encoding. Uses six bits per character, encodes digits, upper-case letters, and many punctuation marks, but has no support for lower-case letters.
*/
EDIFACT: 10,
/**
* Uses ANSI X12 encoding.
*/
ANSIX12: 11,
/**
* ExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext.
* It is better to use DataMatrixExtCodetextBuilder for extended codetext generation.
* Use Display2DText property to set visible text to removing managing characters.
* ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
* All unicode characters after ECI identifier are automatically encoded into correct character codeset.
*
* Encodation schemes are set in the next format : "\Encodation_scheme_name:text\Encodation_scheme_name:text".
* Allowed encodation schemes are: EDIFACT, ANSIX12, ASCII, C40, Text, Auto.
*
* All backslashes (\) must be doubled in text.
*
* @deprecated This property is obsolete and will be removed in future releases. Instead, use the 'Extended' encode mode
*/
EXTENDED_CODETEXT: 12,
/**
* ExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext.
* It is better to use DataMatrixExtCodetextBuilder for extended codetext generation.
* Use Display2DText property to set visible text to removing managing characters.
* ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
* All unicode characters after ECI identifier are automatically encoded into correct character codeset.
*
* Encodation schemes are set in the next format : "\Encodation_scheme_name:text\Encodation_scheme_name:text".
* Allowed encodation schemes are: EDIFACT, ANSIX12, ASCII, C40, Text, Auto.
*
* All backslashes (\) must be doubled in text.
*/
EXTENDED: 13,
/**
* Encode 8 bit values
*/
BASE_256: 14,
/**
* In Binary mode, the CodeText is encoded with maximum data compactness.
* If a Unicode character is found, an exception is thrown.
*/
BINARY: 15,
/**
* In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
* If a character is found that is not supported by the selected ECI encoding, an exception is thrown.
* Please note that some old (pre 2006) scanners may not support this mode.
*/
ECI: 16
};
/**
* Specifies the style of dashed border lines.
* @enum
*/
BorderDashStyle =
{
/**
* Specifies a solid line.
*/
SOLID: 0, //DashStyle.Solid
/**
* Specifies a line consisting of dashes.
*/
DASH: 1, // DashStyle.Dash
/**
* Specifies a line consisting of dots.
*/
DOT: 2, //(DashStyle.Dot
/**
* Specifies a line consisting of a repeating pattern of dash-dot.
*/
DASH_DOT: 3, //DashStyle.DashDot
/**
* Specifies a line consisting of a repeating pattern of dash-dot-dot.
*/
DASH_DOT_DOT: 4, //DashStyle.DashDotDot
};
/**
* ITF14 barcode's border type
* @enum
*/
ITF14BorderType =
{
/**
* NO border enclosing the barcode
*/
NONE: 0,
/**
* FRAME enclosing the barcode
*/
FRAME: 1,
/**
* Tow horizontal bars enclosing the barcode
*/
BAR: 2,
/**
* FRAME enclosing the barcode
*/
FRAME_OUT: 3,
/**
* Tow horizontal bars enclosing the barcode
*/
BAR_OUT: 4,
};
/**
* <p>
* Encoding mode for QR barcodes.
* </p>
* <p><hr><blockquote><pre>
* Example how to use ECI encoding
* <pre>
* generator = new BarcodeGenerator(EncodeTypes.QR, "12345TEXT");
* generator.getParameters().getBarcode().getQR().setQrEncodeMode(QREncodeMode.ECI_ENCODING);
* generator.getParameters().getBarcode().getQR().setQrECIEncoding(ECIEncodings.UTF8);
* generator.save("test.png", BarcodeImageFormat.PNG);
* </pre>
* </pre></blockquote></hr></p>
* <p><hr><blockquote><pre>
* Example how to use FNC1 first position in Extended Mode
* <pre>
* textBuilder = new QrExtCodetextBuilder();
* textBuilder.addPlainCodetext("000%89%%0");
* textBuilder.addFNC1GroupSeparator();
* textBuilder.addPlainCodetext("12345<FNC1>");
* //generate barcode
* generator = new BarcodeGenerator(EncodeTypes.QR);
* generator.setCodeText(textBuilder.getExtended());
* generator.getParameters().getBarcode().getQR().setQrEncodeMode(QREncodeMode.EXTENDED_CODETEXT);
* generator.getParameters().getBarcode().getCodeTextParameters().setTwoDDisplayText("My Text");
* generator.save("d:/test.png", BarcodeImageFormat.PNG);
* </pre>
*
* This sample shows how to use FNC1 second position in Extended Mode.
* <pre>
*
* //create codetext
* textBuilder = new QrExtCodetextBuilder();
* textBuilder.addFNC1SecondPosition("12");
* textBuilder.addPlainCodetext("TRUE3456");
* //generate barcode
* generator = new BarcodeGenerator(EncodeTypes.QR);
* generator.setCodeText(textBuilder.getExtended());
* generator.getParameters().getBarcode().getCodeTextParameters().setTwoDDisplayText("My Text");
* generator.save("d:/test.png", BarcodeImageFormat.PNG);
* </pre>
*
* This sample shows how to use multi ECI mode in Extended Mode.
* <pre>
*
* //create codetext
* textBuilder = new QrExtCodetextBuilder();
* textBuilder.addECICodetext(ECIEncodings.Win1251, "Will");
* textBuilder.addECICodetext(ECIEncodings.UTF8, "Right");
* textBuilder.addECICodetext(ECIEncodings.UTF16BE, "Power");
* textBuilder.addPlainCodetext("t\e\\st");
* //generate barcode
* generator = new BarcodeGenerator(EncodeTypes.QR);
* generator.setCodeText(textBuilder.getExtended());
* generator.getParameters().getBarcode().getQR().setQrEncodeMode(QREncodeMode.EXTENDED_CODETEXT);
* generator.getParameters().getBarcode().getCodeTextParameters().setTwoDDisplayText("My Text");
* generator.save("d:/test.png", BarcodeImageFormat.PNG);
* </pre>
* </pre></blockquote></hr></p>
*/
QREncodeMode =
{
/**
* Encode codetext as is non-unicode charset. <br>
* If there is any unicode character, <br>
* the codetext will be encoded with value which is set in CodeTextEncoding.
*/
AUTO: 0,
/**
* Encode codetext as plain bytes. If it detects any unicode character, the character will be encoded as two bytes, lower byte first.
*/
BYTES: 1,
//https://en.wikipedia.org/wiki/Byte_order_mark
/**
* Encode codetext with UTF8 encoding with first ByteOfMark character.
*/
UTF_8_BOM: 2,
/**
* Encode codetext with UTF8 encoding with first ByteOfMark character. It can be problems with some barcode scaners.
*/
UTF_16_BEBOM: 3,
/**
* Encode codetext with value set in the ECI_ENCODING property. It can be problems with some old (pre 2006) barcode scaners.
*/
ECI_ENCODING: 4,
/**
* Extended Channel mode which supports FNC1 first position, FNC1 second position and multi ECI modes.<br>
* It is better to use QrExtCodetextBuilder for extended codetext generation.<br>
* Use Display2DText property to set visible text to removing managing characters.<br>
* Encoding Principles:<br>
* All symbols "\" must be doubled "\\" in the codetext.<br>
* FNC1 in first position is set in codetext as as "<FNC1>"<br>
* FNC1 in second position is set in codetext as as "<FNC1(value)>". The value must be single symbols (a-z, A-Z) or digits from 0 to 99.<br>
* Group Separator for FNC1 modes is set as 0x1D character '\\u001D' <br>
* If you need to insert "<FNC1>" string into barcode write it as "<\FNC1>" <br>
* ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier<br>
* TO disable current ECI mode and convert to default JIS8 mode zero mode ECI indetifier is set. "\000000"<br>
* All unicode characters after ECI identifier are automatically encoded into correct character codeset.<br>
*/
EXTENDED_CODETEXT: 5
};
/**
* Specify the type of the ECC to encode.
* @enum
*/
DataMatrixEccType =
{
/**
* Specifies that encoded Ecc type is defined by default Reed-Solomon error correction or ECC 200.
*/
ECC_AUTO: 0,
/**
* Specifies that encoded Ecc type is defined ECC 000.
*/
ECC_000: 1,
/**
* Specifies that encoded Ecc type is defined ECC 050.
*/
ECC_050: 2,
/**
* Specifies that encoded Ecc type is defined ECC 080.
*/
ECC_080: 3,
/**
* Specifies that encoded Ecc type is defined ECC 100.
*/
ECC_100: 4,
/**
* Specifies that encoded Ecc type is defined ECC 140.
*/
ECC_140: 5,
/**
* Specifies that encoded Ecc type is defined ECC 200. Recommended to use.
*/
ECC_200: 6
};
/**
* Version of QR Code.
* From Version1 to Version40 for QR code and from M1 to M4 for MicroQr.
* @enum
*/
QRVersion =
{
/**
* Specifies to automatically pick up the best version for QR.<br>
* This is default value.
*/
AUTO: 0,
/**
* Specifies version 1 with 21 x 21 modules.
*/
VERSION_01: 1,
/**
* Specifies version 2 with 25 x 25 modules.
*/
VERSION_02: 2,
/**
* Specifies version 3 with 29 x 29 modules.
*/
VERSION_03: 3,
/**
* Specifies version 4 with 33 x 33 modules.
*/
VERSION_04: 4,
/**
* Specifies version 5 with 37 x 37 modules.
*/
VERSION_05: 5,
/**
* Specifies version 6 with 41 x 41 modules.
*/
VERSION_06: 6,
/**
* Specifies version 7 with 45 x 45 modules.
*/
VERSION_07: 7,
/**
* Specifies version 8 with 49 x 49 modules.
*/
VERSION_08: 8,
/**
* Specifies version 9 with 53 x 53 modules.
*/
VERSION_09: 9,
/**
* Specifies version 10 with 57 x 57 modules.
*/
VERSION_10: 10,
/**
* Specifies version 11 with 61 x 61 modules.
*/
VERSION_11: 11,
/**
* Specifies version 12 with 65 x 65 modules.
*/
VERSION_12: 12,
/**
* Specifies version 13 with 69 x 69 modules.
*/
VERSION_13: 13,
/**
* Specifies version 14 with 73 x 73 modules.
*/
VERSION_14: 14,
/**
* Specifies version 15 with 77 x 77 modules.
*/
VERSION_15: 15,
/**
* Specifies version 16 with 81 x 81 modules.
*/
VERSION_16: 16,
/**
* Specifies version 17 with 85 x 85 modules.
*/
VERSION_17: 17,
/**
* Specifies version 18 with 89 x 89 modules.
*/
VERSION_18: 18,
/**
* Specifies version 19 with 93 x 93 modules.
*/
VERSION_19: 19,
/**
* Specifies version 20 with 97 x 97 modules.
*/
VERSION_20: 20,
/**
* Specifies version 21 with 101 x 101 modules.
*/
VERSION_21: 21,
/**
* Specifies version 22 with 105 x 105 modules.
*/
VERSION_22: 22,
/**
* Specifies version 23 with 109 x 109 modules.
*/
VERSION_23: 23,
/**
* Specifies version 24 with 113 x 113 modules.
*/
VERSION_24: 24,
/**
* Specifies version 25 with 117 x 117 modules.
*/
VERSION_25: 25,
/**
* Specifies version 26 with 121 x 121 modules.
*/
VERSION_26: 26,
/**
* Specifies version 27 with 125 x 125 modules.
*/
VERSION_27: 27,
/**
* Specifies version 28 with 129 x 129 modules.
*/
VERSION_28: 28,
/**
* Specifies version 29 with 133 x 133 modules.
*/
VERSION_29: 29,
/**
* Specifies version 30 with 137 x 137 modules.
*/
VERSION_30: 30,
/**
* Specifies version 31 with 141 x 141 modules.
*/
VERSION_31: 31,
/**
* Specifies version 32 with 145 x 145 modules.
*/
VERSION_32: 32,
/**
* Specifies version 33 with 149 x 149 modules.
*/
VERSION_33: 33,
/**
* Specifies version 34 with 153 x 153 modules.
*/
VERSION_34: 34,
/**
* Specifies version 35 with 157 x 157 modules.
*/
VERSION_35: 35,
/**
* Specifies version 36 with 161 x 161 modules.
*/
VERSION_36: 36,
/**
* Specifies version 37 with 165 x 165 modules.
*/
VERSION_37: 37,
/**
* Specifies version 38 with 169 x 169 modules.
*/
VERSION_38: 38,
/**
* Specifies version 39 with 173 x 173 modules.
*/
VERSION_39: 39,
/**
* Specifies version 40 with 177 x 177 modules.
*/
VERSION_40: 40,
/**
* Specifies version M1 for Micro QR with 11 x 11 modules.
*/
VERSION_M1: 101,
/**
* Specifies version M2 for Micro QR with 13 x 13 modules.
*/
VERSION_M2: 102,
/**
* Specifies version M3 for Micro QR with 15 x 15 modules.
*/
VERSION_M3: 103,
/**
* Specifies version M4 for Micro QR with 17 x 17 modules.
*/
VERSION_M4: 104,
};
/**
* Specifies the Aztec symbol mode.
* @example
* let generator = new BarcodeGenerator(EncodeTypes.AZTEC);
* generator.setCodeText("125");
* generator.getParameters().getBarcode().getAztec().setAztecSymbolMode(AztecSymbolMode.RUNE);
* generator.save("test.png", BarCodeImageFormat.PNG);
* @enum
*/
AztecSymbolMode =
{
/**
* Specifies to automatically pick up the best symbol (COMPACT or FULL-range) for Aztec.<br>
* This is default value.
* @enum
*/
AUTO: 0,
/**
* Specifies the COMPACT symbol for Aztec.<br>
* Aztec COMPACT symbol permits only 1, 2, 3 or 4 layers.
*/
COMPACT: 1,
/**
* Specifies the FULL-range symbol for Aztec.<br>
* Aztec FULL-range symbol permits from 1 to 32 layers.
*/
FULL_RANGE: 2,
/**
* Specifies the RUNE symbol for Aztec.<br>
* Aztec Runes are a series of small but distinct machine-readable marks. It permits only number value from 0 to 255.
*/
RUNE: 3
};
/**
* pdf417 barcode's error correction level, from level 0 to level 9, level 0 means no error correction, level 9 means best error correction
* @enum
*/
Pdf417ErrorLevel =
{
/**
* level = 0.
*/
LEVEL_0: 0,
/**
* level = 1.
*/
LEVEL_1: 1,
/**
* level = 2.
*/
LEVEL_2: 2,
/**
* level = 3.
*/
LEVEL_3: 3,
/**
* level = 4.
*/
LEVEL_4: 4,
/**
* level = 5.
*/
LEVEL_5: 5,
/**
* level = 6.
*/
LEVEL_6: 6,
/**
* level = 7.
*/
LEVEL_7: 7,
/**
* level = 8.
*/
LEVEL_8: 8
};
/**
* Pdf417 barcode's compation mode
* @enum
*/
Pdf417CompactionMode =
{
/**
* auto detect compation mode
*/
AUTO: 0,
/**
* text compaction
*/
TEXT: 1,
/**
* numeric compaction mode
*/
NUMERIC: 2,
/**
* binary compaction mode
*/
BINARY: 3
};
/**
* Level of Reed-Solomon error correction. From low to high: LEVEL_L, LEVEL_M, LEVEL_Q, LEVEL_H.
* @enum
*/
QRErrorLevel =
{
/**
* Allows recovery of 7% of the code text
*/
LEVEL_L: 0,
/**
* Allows recovery of 15% of the code text
*/
LEVEL_M: 1,
/**
* Allows recovery of 25% of the code text
*/
LEVEL_Q: 2,
/**
* Allows recovery of 30% of the code text
*/
LEVEL_H: 3
};
/**
* QR / MicroQR selector mode. Select FORCE_QR for standard QR symbols, AUTO for MicroQR.<br>
* FORCE_MICRO_QR is used for strongly MicroQR symbol generation if it is possible.
* @enum
*/
QREncodeType =
{
/**
* Mode starts barcode version negotiation from MicroQR V1
*/
AUTO: 0,
/**
* Mode starts barcode version negotiation from QR V1
*/
FORCE_QR: 1,
/**
* Mode starts barcode version negotiation from from MicroQR V1 to V4. If data cannot be encoded into MicroQR, exception is thrown.
*/
FORCE_MICRO_QR: 2
};
/**
* Specifies the checksum algorithm for Codabar
* @enum
*/
CodabarChecksumMode =
{
/**
* Specifies Mod 10 algorithm for Codabar.
*/
MOD_10: 0,
/**
* Specifies Mod 16 algorithm for Codabar (recomended AIIM).
*/
MOD_16: 1
};
/**
* Codetext location
* @enum
*/
CodeLocation =
{
/**
* Codetext below barcode.
*/
BELOW: 0,
/**
* Codetext above barcode.
*/
ABOVE: 1,
/**
* Hide codetext.
*/
NONE: 2
};
/**
* Font size mode.
* @enum
*/
FontMode =
{
/**
* Automatically calculate Font size based on barcode size.
*/
AUTO: 0,
/**
* Use Font sized defined by user.
*/
MANUAL: 1
};
/**
* Text alignment.
* @enum
*/
TextAlignment =
{
/**
* Left position.
*/
LEFT: 0,
/**
* Center position.
*/
CENTER: 1,
/**
* Right position.
*/
RIGHT: 2
};
/**
* Specifies the different types of automatic sizing modes.<br>
* Default value is AutoSizeMode.NONE.
* @example
* //This sample shows how to create and save a BarCode image:
* let generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
* generator.setAutoSizeMode(AutoSizeMode.NEAREST);
* generator.getBarCodeWidth().setMillimeters(50);
* generator.getBarCodeHeight().setInches(1.3f);
* generator.save("test.png", BarcodeImageFormat.PNG);
*
* @enum
*/
AutoSizeMode =
{
/**
* Automatic resizing is disabled. Default value.
*/
NONE: 0, //or CUSTOM, or DEFAULT
/**
* Barcode resizes to nearest lowest possible size<br>
* which are specified by BarCodeWidth and BarCodeHeight properties.
*/
NEAREST: 1,
/**
* Resizes barcode to specified size with little scaling<br>
* but it can be little damaged in some cases<br>
* because using interpolation for scaling.<br>
* Size can be specified by BarcodeGenerator.BarCodeWidth<br>
* and BarcodeGenerator.BarCodeHeight properties.<br>
* @example
* This sample shows how to create and save a BarCode image in Scale mode.
*
* let generator = new BarcodeGenerator( EncodeTypes.DATA_MATRIX);
* generator.getParameters().getBarcode().setAutoSizeMode(AutoSizeMode.INTERPOLATION);
* generator.getParameters().getBarcode().getBarCodeWidth().setMillimeters(50);
* generator.getParameters().getBarcode().getBarCodeHeight().setInches(1.3);
* generator.save("test.png", BarcodeImageFormat.PNG);
*/
INTERPOLATION: 2,
};
/**
* Specifies the unit of measure for the given data.
* @enum
*/
GraphicsUnit =
{
/**
* Specifies the world coordinate system unit as the unit of measure.
*/
WORLD: 0,
/**
* Specifies the unit of measure of the display device. Typically pixels for video displays, and 1/100 inch for printers.
*/
DISPLAY: 1,
/**
* Specifies a device pixel as the unit of measure.
*/
PIXEL: 2,
/**
* Specifies a printer's point = 1/72 inch) as the unit of measure.
*/
POINT: 3,
/**
* Specifies the inch as the unit of measure.
*/
INCH: 4,
/**
* Specifies the document unit = 1/300 inch) as the unit of measure.
*/
DOCUMENT: 5,
/**
* Specifies the millimeter as the unit of measure.
*/
MILLIMETER: 6,
};
/**
* Specifies the type of barcode to encode.
* @enum
*/
EncodeTypes =
{
/**
* Unspecified encode type.
*/
NONE: -1,
/**
* Specifies that the data should be encoded with CODABAR barcode specification
*/
CODABAR: 0,
/**
* Specifies that the data should be encoded with CODE 11 barcode specification
*/
CODE_11: 1,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>Code 39</b>} basic charset barcode specification: ISO/IEC 16388
* </p>
*/
CODE_39: 2,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>Code 39</b>} full ASCII charset barcode specification: ISO/IEC 16388
* </p>
*/
CODE_39_FULL_ASCII: 3,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>CODE 93</b>} barcode specification
* </p>
*/
CODE_93: 5,
/**
* Specifies that the data should be encoded with CODE 128 barcode specification
*/
CODE_128: 6,
/**
* Specifies that the data should be encoded with GS1 Code 128 barcode specification. The codetext must contains parentheses for AI.
*/
GS_1_CODE_128: 7,
/**
* Specifies that the data should be encoded with EAN-8 barcode specification
*/
EAN_8: 8,
/**
* Specifies that the data should be encoded with EAN-13 barcode specification
*/
EAN_13: 9,
/**
* Specifies that the data should be encoded with EAN14 barcode specification
*/
EAN_14: 10,
/**
* Specifies that the data should be encoded with SCC14 barcode specification
*/
SCC_14: 11,
/**
* Specifies that the data should be encoded with SSCC18 barcode specification
*/
SSCC_18: 12,
/**
* Specifies that the data should be encoded with UPC-A barcode specification
*/
UPCA: 13,
/**
* Specifies that the data should be encoded with UPC-E barcode specification
*/
UPCE: 14,
/**
* Specifies that the data should be encoded with isBN barcode specification
*/
ISBN: 15,
/**
* Specifies that the data should be encoded with ISSN barcode specification
*/
ISSN: 16,
/**
* Specifies that the data should be encoded with ISMN barcode specification
*/
ISMN: 17,
/**
* Specifies that the data should be encoded with Standard 2 of 5 barcode specification
*/
STANDARD_2_OF_5: 18,
/**
* Specifies that the data should be encoded with INTERLEAVED 2 of 5 barcode specification
*/
INTERLEAVED_2_OF_5: 19,
/**
* Represents Matrix 2 of 5 BarCode
*/
MATRIX_2_OF_5: 20,
/**
* Represents Italian Post 25 barcode.
*/
ITALIAN_POST_25: 21,
/**
* Represents IATA 2 of 5 barcode.IATA (International Air Transport Assosiation) uses this barcode for the management of air cargo.
*/
IATA_2_OF_5: 22,
/**
* Specifies that the data should be encoded with ITF14 barcode specification
*/
ITF_14: 23,
/**
* Represents ITF-6 Barcode.
*/
ITF_6: 24,
/**
* Specifies that the data should be encoded with MSI Plessey barcode specification
*/
MSI: 25,
/**
* Represents VIN (Vehicle Identification Number) Barcode.
*/
VIN: 26,
/**
* Represents Deutsch Post barcode, This EncodeType is also known as Identcode,CodeIdentcode,German Postal 2 of 5 Identcode,<br>
* Deutsch Post AG Identcode, Deutsch Frachtpost Identcode, Deutsch Post AG (DHL)
*/
DEUTSCHE_POST_IDENTCODE: 27,
/**
* Represents Deutsch Post Leitcode Barcode,also known as German Postal 2 of 5 Leitcode, CodeLeitcode, Leitcode, Deutsch Post AG (DHL).
*/
DEUTSCHE_POST_LEITCODE: 28,
/**
* Represents OPC(Optical Product Code) Barcode,also known as , VCA Barcode VCA OPC, Vision Council of America OPC Barcode.
*/
OPC: 29,
/**
* Represents PZN barcode.This EncodeType is also known as Pharmacy central number, Pharmazentralnummer
*/
PZN: 30,
/**
* Represents Code 16K barcode.
*/
CODE_16_K: 31,
/**
* Represents Pharmacode barcode.
*/
PHARMACODE: 32,
/**
* 2D barcode symbology DataMatrix
*/
DATA_MATRIX: 33,
/**
* Specifies that the data should be encoded with QR Code barcode specification
*/
QR: 34,
/**
* Specifies that the data should be encoded with Aztec barcode specification
*/
AZTEC: 35,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>GS1 Aztec</b>} barcode specification. The codetext must contains parentheses for AI.
* </p>
*/
GS_1_AZTEC: 81,
/**
* Specifies that the data should be encoded with Pdf417 barcode specification
*/
PDF_417: 36,
/**
* Specifies that the data should be encoded with MacroPdf417 barcode specification
*/
MACRO_PDF_417: 37,
/**
* 2D barcode symbology DataMatrix with GS1 string format
*/
GS_1_DATA_MATRIX: 48,
/**
* Specifies that the data should be encoded with MicroPdf417 barcode specification
*/
MICRO_PDF_417: 55,
/**
* Specifies that the data should be encoded with <b>GS1MicroPdf417</b> barcode specification
*/
GS_1_MICRO_PDF_417: 82,
/**
* 2D barcode symbology QR with GS1 string format
*/
GS_1_QR: 56,
/**
* Specifies that the data should be encoded with MaxiCode barcode specification
*/
MAXI_CODE: 57,
/**
* Specifies that the data should be encoded with DotCode barcode specification
*/
DOT_CODE: 60,
/**
* Represents Australia Post Customer BarCode
*/
AUSTRALIA_POST: 38,
/**
* Specifies that the data should be encoded with Postnet barcode specification
*/
POSTNET: 39,
/**
* Specifies that the data should be encoded with Planet barcode specification
*/
PLANET: 40,
/**
* Specifies that the data should be encoded with USPS OneCode barcode specification
*/
ONE_CODE: 41,
/**
* Represents RM4SCC barcode. RM4SCC (Royal Mail 4-state Customer Code) is used for automated mail sort process in UK.
*/
RM_4_SCC: 42,
/**
* Represents Royal Mail Mailmark barcode.
*/
MAILMARK: 66,
/**
* Specifies that the data should be encoded with GS1 Databar omni-directional barcode specification.
*/
DATABAR_OMNI_DIRECTIONAL: 43,
/**
* Specifies that the data should be encoded with GS1 Databar truncated barcode specification.
*/
DATABAR_TRUNCATED: 44,
/**
* Represents GS1 DATABAR limited barcode.
*/
DATABAR_LIMITED: 45,
/**
* Represents GS1 Databar expanded barcode.
*/
DATABAR_EXPANDED: 46,
/**
* Represents GS1 Databar expanded stacked barcode.
*/
DATABAR_EXPANDED_STACKED: 52,
/**
* Represents GS1 Databar stacked barcode.
*/
DATABAR_STACKED: 53,
/**
* Represents GS1 Databar stacked omni-directional barcode.
*/
DATABAR_STACKED_OMNI_DIRECTIONAL: 54,
/**
* Specifies that the data should be encoded with Singapore Post Barcode barcode specification
*/
SINGAPORE_POST: 47,
/**
* Specifies that the data should be encoded with Australian Post Domestic eParcel Barcode barcode specification
*/
AUSTRALIAN_POSTE_PARCEL: 49,
/**
* Specifies that the data should be encoded with Swiss Post Parcel Barcode barcode specification. Supported types: Domestic Mail, International Mail, Additional Services (new)
*/
SWISS_POST_PARCEL: 50,
/**
* Represents Patch code barcode
*/
PATCH_CODE: 51,
/**
* Specifies that the data should be encoded with Code32 barcode specification
*/
CODE_32: 58,
/**
* Specifies that the data should be encoded with DataLogic 2 of 5 barcode specification
*/
DATA_LOGIC_2_OF_5: 59,
/**
* Specifies that the data should be encoded with Dutch KIX barcode specification
*/
DUTCH_KIX: 61,
/**
* Specifies that the data should be encoded with UPC coupon with GS1-128 Extended Code barcode specification.<br>
* @example
* An example of the input string:
* BarCodeGenerator.setCodetext("514141100906(8102)03"),
* where UPCA part is "514141100906", GS1Code128 part is (8102)03.
*/
UPCA_GS_1_CODE_128_COUPON: 62,
/**
* Specifies that the data should be encoded with UPC coupon with GS1 DataBar addition barcode specification.<br>
* @example
* An example of the input string:
* BarCodeGenerator.setCodetext("514141100906(8110)106141416543213500110000310123196000"),
* where UPCA part is "514141100906, DATABAR part is "(8110)106141416543213500110000310123196000".
* To change the caption, use barCodeBuilder.getCaptionAbove().setText("company prefix + offer code")",
*/
UPCA_GS_1_DATABAR_COUPON: 63,
/**
* Specifies that the data should be encoded with Codablock-F barcode specification.
*/
CODABLOCK_F: 64,
/**
* Specifies that the data should be encoded with GS1 Codablock-F barcode specification. The codetext must contains parentheses for AI.
*/
GS_1_CODABLOCK_F: 65,
/**
* Specifies that the data should be encoded with <b>GS1 Composite Bar</b> barcode specification. The codetext must contains parentheses for AI. 1D codetext and 2D codetext must be separated with symbol '/'
*/
GS_1_COMPOSITE_BAR: 67,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>HIBC LIC Code39Standart</b>} barcode specification.
* </p>
*/
HIBC_CODE_39_LIC: 68,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>HIBC LIC Code128</b>} barcode specification.
* </p>
*/
HIBC_CODE_128_LIC: 69,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>HIBC LIC Aztec</b>} barcode specification.
* </p>
*/
HIBC_AZTEC_LIC: 70,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>HIBC LIC DataMatrix</b>} barcode specification.
* </p>
*/
HIBC_DATA_MATRIX_LIC: 71,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>HIBC LIC QR</b>} barcode specification.
* </p>
*/
HIBCQRLIC: 72,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>HIBC PAS Code39Standart</b>} barcode specification.
* </p>
*/
HIBC_CODE_39_PAS: 73,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>HIBC PAS Code128</b>} barcode specification.
* </p>
*/
HIBC_CODE_128_PAS: 74,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>HIBC PAS Aztec</b>} barcode specification.
* </p>
*/
HIBC_AZTEC_PAS: 75,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>HIBC PAS DataMatrix</b>} barcode specification.
* </p>
*/
HIBC_DATA_MATRIX_PAS: 76,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>HIBC PAS QR</b>} barcode specification.
* </p>
*/
HIBCQRPAS: 77,
/**
* <p>
* Specifies that the data should be encoded with {@code <b>GS1 DotCode</b>} barcode specification. The codetext must contains parentheses for AI.
* </p>
*/
GS_1_DOT_CODE: 78,
/**
* Specifies that the data should be encoded with <b>Han Xin</b> barcode specification
*/
HAN_XIN: 79,
/**
* 2D barcode symbology QR with GS1 string format
*/
GS_1_HAN_XIN: 80,
/**
* Specifies that the data should be encoded with <b>MicroQR Code</b> barcode specification
*/
MICRO_QR: 83,
/**
* Specifies that the data should be encoded with <b>RectMicroQR (rMQR) Code</b> barcode specification
*/
RECT_MICRO_QR: 84,
parse(encodeTypeName)
{
if (encodeTypeName == "CODABAR") {
return 0;
}
else if (encodeTypeName == "CODE_11") {
return 1;
}
else if (encodeTypeName == "CODE_39") {
return 2;
}
else if (encodeTypeName == "CODE_39_FULL_ASCII") {
return 3;
}
else if (encodeTypeName == "CODE_93") {
return 5;
}
else if (encodeTypeName == "CODE_128") {
return 6;
}
else if (encodeTypeName == "GS_1_CODE_128") {
return 7;
}
else if (encodeTypeName == "EAN_8") {
return 8;
}
else if (encodeTypeName == "EAN_13") {
return 9;
}
else if (encodeTypeName == "EAN_14") {
return 10;
}
else if (encodeTypeName == "SCC_14") {
return 11;
}
else if (encodeTypeName == "SSCC_18") {
return 12;
}
else if (encodeTypeName == "UPCA") {
return 13;
}
else if (encodeTypeName == "UPCE") {
return 14;
}
else if (encodeTypeName == "ISBN") {
return 15;
}
else if (encodeTypeName == "ISSN") {
return 16;
}
else if (encodeTypeName == "ISMN") {
return 17;
}
else if (encodeTypeName == "STANDARD_2_OF_5") {
return 18;
}
else if (encodeTypeName == "INTERLEAVED_2_OF_5") {
return 19;
}
else if (encodeTypeName == "MATRIX_2_OF_5") {
return 20;
}
else if (encodeTypeName == "ITALIAN_POST_25") {
return 21;
}
else if (encodeTypeName == "IATA_2_OF_5") {
return 22;
}
else if (encodeTypeName == "ITF_14") {
return 23;
}
else if (encodeTypeName == "ITF_6") {
return 24;
}
else if (encodeTypeName == "MSI") {
return 25;
}
else if (encodeTypeName == "VIN") {
return 26;
}
else if (encodeTypeName == "DEUTSCHE_POST_IDENTCODE") {
return 27;
}
else if (encodeTypeName == "DEUTSCHE_POST_LEITCODE") {
return 28;
}
else if (encodeTypeName == "OPC") {
return 29;
}
else if (encodeTypeName == "PZN") {
return 30;
}
else if (encodeTypeName == "CODE_16_K") {
return 31;
}
else if (encodeTypeName == "PHARMACODE") {
return 32;
}
else if (encodeTypeName == "DATA_MATRIX") {
return 33;
}
else if (encodeTypeName == "QR") {
return 34;
}
else if (encodeTypeName == "AZTEC") {
return 35;
}
else if (encodeTypeName == "GS_1_AZTEC") {
return 81;
}
else if (encodeTypeName == "PDF_417") {
return 36;
}
else if (encodeTypeName == "MACRO_PDF_417") {
return 37;
}
else if (encodeTypeName == "GS_1_DATA_MATRIX") {
return 48;
}
else if (encodeTypeName == "MICRO_PDF_417") {
return 55;
}
else if (encodeTypeName == "GS_1_QR") {
return 56;
}
else if (encodeTypeName == "MAXI_CODE") {
return 57;
}
else if (encodeTypeName == "DOT_CODE") {
return 60;
}
else if (encodeTypeName == "AUSTRALIA_POST") {
return 38;
}
else if (encodeTypeName == "POSTNET") {
return 39;
}
else if (encodeTypeName == "PLANET") {
return 40;
}
else if (encodeTypeName == "ONE_CODE") {
return 41;
}
else if (encodeTypeName == "RM_4_SCC") {
return 42;
}
else if (encodeTypeName == "MAILMARK") {
return 66;
}
else if (encodeTypeName == "DATABAR_OMNI_DIRECTIONAL") {
return 43;
}
else if (encodeTypeName == "DATABAR_TRUNCATED") {
return 44;
}
else if (encodeTypeName == "DATABAR_LIMITED") {
return 45;
}
else if (encodeTypeName == "DATABAR_EXPANDED") {
return 46;
}
else if (encodeTypeName == "DATABAR_EXPANDED_STACKED") {
return 52;
}
else if (encodeTypeName == "DATABAR_STACKED") {
return 53;
}
else if (encodeTypeName == "DATABAR_STACKED_OMNI_DIRECTIONAL") {
return 54;
}
else if (encodeTypeName == "SINGAPORE_POST") {
return 47;
}
else if (encodeTypeName == "AUSTRALIAN_POSTE_PARCEL") {
return 49;
}
else if (encodeTypeName == "SWISS_POST_PARCEL") {
return 50;
}
else if (encodeTypeName == "PATCH_CODE") {
return 51;
}
else if (encodeTypeName == "CODE_32") {
return 58;
}
else if (encodeTypeName == "DATA_LOGIC_2_OF_5") {
return 59;
}
else if (encodeTypeName == "DUTCH_KIX") {
return 61;
}
else if (encodeTypeName == "UPCA_GS_1_CODE_128_COUPON") {
return 62;
}
else if (encodeTypeName == "UPCA_GS_1_DATABAR_COUPON") {
return 63;
}
else if (encodeTypeName == "CODABLOCK_F") {
return 64;
}
else if (encodeTypeName == "GS_1_CODABLOCK_F") {
return 65;
}
else if (encodeTypeName == "GS_1_COMPOSITE_BAR") {
return 67;
}
else if (encodeTypeName == "HIBC_CODE_39_LIC") {
return 68;
}
else if (encodeTypeName == "HIBC_CODE_128_LIC") {
return 69;
}
else if (encodeTypeName == "HIBC_AZTEC_LIC") {
return 70;
}
else if (encodeTypeName == "HIBC_DATA_MATRIX_LIC") {
return 71;
}
else if (encodeTypeName == "HIBCQRLIC") {
return 72;
}
else if (encodeTypeName == "HIBC_CODE_39_PAS") {
return 73;
}
else if (encodeTypeName == "HIBC_CODE_128_PAS") {
return 74;
}
else if (encodeTypeName == "HIBC_AZTEC_PAS") {
return 75;
}
else if (encodeTypeName == "HIBC_DATA_MATRIX_PAS") {
return 76;
}
else if (encodeTypeName == "HIBCQRPAS") {
return 77;
}
else if (encodeTypeName == "GS_1_DOT_CODE") {
return 78;
}
else if (encodeTypeName == "HAN_XIN") {
return 79;
}
else if (encodeTypeName == "GS_1_HAN_XIN") {
return 80;
}
else if (encodeTypeName == "MICRO_QR") {
return 83;
}
else if (encodeTypeName == "RECT_MICRO_QR") {
return 84;
}
else {
return -1;
}
}
}
/**
* <p>
* <p>Extended codetext generator for Aztec barcodes for ExtendedCodetext Mode of AztecEncodeMode</p>
* <p>Use TwoDDisplayText property of BarcodeGenerator to set visible text to removing managing characters.</p>
* </p><p><hr><blockquote><pre>
* This sample shows how to use AztecExtCodetextBuilder in Extended Mode.
* <pre>
* @example
* //create codetext
* let textBuilder = new AztecExtCodetextBuilder();
* textBuilder.addECICodetext(ECIEncodings.Win1251, "Will");
* textBuilder.addECICodetext(ECIEncodings.UTF8, "犬Right狗");
* textBuilder.addECICodetext(ECIEncodings.UTF16BE, "犬Power狗");
* textBuilder.addPlainCodetext("Plain text");
* //generate codetext
* let codetext = textBuilder.getExtendedCodetext();
* //generate
* let generator = new BarcodeGenerator(EncodeTypes.AZTEC, codetext);
* generator.getParameters().getBarcode().getCodeTextParameters().setwoDDisplayText("My Text");
* generator.save("test.bmp", BarcodeImageFormat.BMP);
*/
class AztecExtCodetextBuilder extends ExtCodetextBuilder
{
static JAVA_CLASS_NAME = "com.aspose.mw.barcode.generation.MwAztecExtCodetextBuilder";
constructor()
{
let java_class_link = java.import(AztecExtCodetextBuilder.JAVA_CLASS_NAME);
let javaClass = new java_class_link();
super(javaClass);
}
init()
{
}
/**
* <p>
* Generates Extended codetext from the extended codetext list.
* </p>
* @return Extended codetext as string
*/
getExtendedCodetext()
{
return this.getJavaClass().getExtendedCodetextSync();
}
}
/**
* Macro Characters 05 and 06 values are used to obtain more compact encoding in special modes.
* 05 Macro craracter is translated to "[)>\u001E05\u001D" as decoded data header and "\u001E\u0004" as decoded data trailer.
* 06 Macro craracter is translated to "[)>\u001E06\u001D" as decoded data header and "\u001E\u0004" as decoded data trailer.
* <pre>
* hese samples show how to encode Macro Characters in MicroPdf417 and DataMatrix
* <pre>
*
* @example
* # to generate autoidentified GS1 message like this "(10)123ABC(10)123ABC" in ISO 15434 format you need:
* let generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX, "10123ABC\u001D10123ABC");
* generator.getParameters().getBarcode().getDataMatrix().setMacroCharacters(MacroCharacter.MACRO_05);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.GS1DataMatrix);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log("BarCode CodeText: " + result.getCodeText());
* });
*
* @example
* # Encodes MicroPdf417 with 05 Macro the string: "[)>\u001E05\u001Dabcde1234\u001E\u0004"
* let generator = new BarcodeGenerator(EncodeTypes.MicroPdf417, "abcde1234");
* generator.getParameters().getBarcode().getPdf417().setMacroCharacters(MacroCharacter.MACRO_05);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log( result.getCodeText());
* });
*
* @example
* # Encodes MicroPdf417 with 06 Macro the string: "[)>\u001E06\u001Dabcde1234\u001E\u0004"
* let generator = new BarcodeGenerator(EncodeTypes.MicroPdf417, "abcde1234");
* generator.getParameters().getBarcode().getPdf417().setMacroCharacters(MacroCharacter.MACRO_06);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), null, DecodeType.MICRO_PDF_417);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* console.log( result.getCodeText());
* });
* </pre>
* </pre>
*/
MacroCharacter =
{
/**
* None of Macro Characters are added to barcode data
*/
NONE: 0,
/**
* 05 Macro craracter is added to barcode data in first position.<br>
* GS1 Data Identifier ISO 15434<br>
* Character is translated to "[)>\u001E05\u001D" as decoded data header and "\u001E\u0004" as decoded data trailer.
*
* @example
* //to generate autoidentified GS1 message like this "(10)123ABC(10)123ABC" in ISO 15434 format you need:
* let generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX, "10123ABC\u001D10123ABC");
* generator.getParameters().getBarcode().getDataMatrix().setMacroCharacters(MacroCharacter.MACRO_05);
* let reader = new BarCodeReader(generator.generateBarCodeImage(BarcodeImageFormat.PNG), DecodeType.GS_1_DATA_MATRIX);
* reader.readBarCodes().forEach(function(result, i, results)
* {
* cosole.log("BarCode CodeText: " + result.getCodeText());
* });
*/
MACRO_05: 5,
/**
* 06 Macro craracter is added to barcode data in first position.<br>
* ASC MH10 Data Identifier ISO 15434<br>
* Character is translated to "[)>\u001E06\u001D" as decoded data header and "\u001E\u0004" as decoded data trailer.
*/
MACRO_06: 6
};
/**
* PatchCode format. Choose PatchOnly to generate single PatchCode. Use page format to generate Patch page with PatchCodes as borders
* @enum
*/
PatchFormat =
{
/**
* Generates PatchCode only
*/
PATCH_ONLY: 0,
/**
* Generates A4 format page with PatchCodes as borders and optional QR in the center
*/
A4: 1,
/**
* Generates A4 landscape format page with PatchCodes as borders and optional QR in the center
*/
A4_LANDSCAPE: 2,
/**
* Generates US letter format page with PatchCodes as borders and optional QR in the center
*/
US_LETTER: 3,
/**
* Generates US letter landscape format page with PatchCodes as borders and optional QR in the center
*/
US_LETTER_LANDSCAPE: 4
};
/**
* Extended Channel Interpretation Identifiers. It is used to tell the barcode reader details<br>
* about the used references for encoding the data in the symbol.<br>
* Current implementation consists all well known charset encodings.<br>
* Currently, it is used only for QR 2D barcode.
*
* @example
* let generator = new BarcodeGenerator(EncodeTypes.QR);
* generator.setCodeText("12345TEXT");
* generator.getParameters().getBarcode().getQR().setQrEncodeMode(QREncodeMode.ECI_ENCODING);
* generator.getParameters().getBarcode().getQR().setQrEncodeType(QREncodeType.FORCE_QR);
* generator.getParameters().getBarcode().getQR().setQrECIEncoding(ECIEncodings.UTF_8);
* generator.save("test.png", BarCodeImageFormat.PNG);
*
* @enum
*/
ECIEncodings =
{
/**
* ISO/IEC 8859-1 Latin alphabet No. 1 encoding. ECI Id:"\000003"
*/
ISO_8859_1: 3,
/**
* ISO/IEC 8859-2 Latin alphabet No. 2 encoding. ECI Id:"\000004"
*/
ISO_8859_2: 4,
/**
* ISO/IEC 8859-3 Latin alphabet No. 3 encoding. ECI Id:"\000005"
*/
ISO_8859_3: 5,
/**
* ISO/IEC 8859-4 Latin alphabet No. 4 encoding. ECI Id:"\000006"
*/
ISO_8859_4: 6,
/**
* ISO/IEC 8859-5 Latin/Cyrillic alphabet encoding. ECI Id:"\000007"
*/
ISO_8859_5: 7,
/**
* ISO/IEC 8859-6 Latin/Arabic alphabet encoding. ECI Id:"\000008"
*/
ISO_8859_6: 8,
/**
* ISO/IEC 8859-7 Latin/Greek alphabet encoding. ECI Id:"\000009"
*/
ISO_8859_7: 9,
/**
* ISO/IEC 8859-8 Latin/Hebrew alphabet encoding. ECI Id:"\000010"
*/
ISO_8859_8: 10,
/**
* ISO/IEC 8859-9 Latin alphabet No. 5 encoding. ECI Id:"\000011"
*/
ISO_8859_9: 11,
/**
* ISO/IEC 8859-10 Latin alphabet No. 6 encoding. ECI Id:"\000012"
*/
ISO_8859_10: 12,
/**
* ISO/IEC 8859-11 Latin/Thai alphabet encoding. ECI Id:"\000013"
*/
ISO_8859_11: 13,
//14 is reserved
/**
* ISO/IEC 8859-13 Latin alphabet No. 7 (Baltic Rim) encoding. ECI Id:"\000015"
*/
ISO_8859_13: 15,
/**
* ISO/IEC 8859-14 Latin alphabet No. 8 (Celtic) encoding. ECI Id:"\000016"
*/
ISO_8859_14: 16,
/**
* ISO/IEC 8859-15 Latin alphabet No. 9 encoding. ECI Id:"\000017"
*/
ISO_8859_15: 17,
/**
* ISO/IEC 8859-16 Latin alphabet No. 10 encoding. ECI Id:"\000018"
*/
ISO_8859_16: 18,
//19 is reserved
/**
* Shift JIS (JIS X 0208 Annex 1 + JIS X 0201) encoding. ECI Id:"\000020"
*/
Shift_JIS: 20,
//
/**
* Windows 1250 Latin 2 (Central Europe) encoding. ECI Id:"\000021"
*/
Win1250: 21,
/**
* Windows 1251 Cyrillic encoding. ECI Id:"\000022"
*/
Win1251: 22,
/**
* Windows 1252 Latin 1 encoding. ECI Id:"\000023"
*/
Win1252: 23,
/**
* Windows 1256 Arabic encoding. ECI Id:"\000024"
*/
Win1256: 24,
//
/**
* ISO/IEC 10646 UCS-2 (High order byte first) encoding. ECI Id:"\000025"
*/
UTF16BE: 25,
/**
* ISO/IEC 10646 UTF-8 encoding. ECI Id:"\000026"
*/
UTF8: 26,
//
/**
* ISO/IEC 646:1991 International Reference Version of ISO 7-bit coded character set encoding. ECI Id:"\000027"
*/
US_ASCII: 27,
/**
* Big 5 (Taiwan) Chinese Character Set encoding. ECI Id:"\000028"
*/
Big5: 28,
/**
* GB (PRC) Chinese Character Set encoding. ECI Id:"\000029"
*/
GB2312: 29,
/**
* Korean Character Set encoding. ECI Id:"\000030"
*/
EUC_KR: 30,
/**
* <p>GBK (extension of GB2312 for Simplified Chinese) encoding. ECI Id:"\000031"</p>
*/
GBK: 31,
/**
* <p>GGB18030 Chinese Character Set encoding. ECI Id:"\000032"</p>
*/
GB18030: 32,
/**
* <p> ISO/IEC 10646 UTF-16LE encoding. ECI Id:"\000033"</p>
*/
UTF16LE: 33,
/**
* <p> ISO/IEC 10646 UTF-32BE encoding. ECI Id:"\000034"</p>
*/
UTF32BE: 34,
/**
* <p> ISO/IEC 10646 UTF-32LE encoding. ECI Id:"\000035"</p>
*/
UTF32LE: 35,
/**
* <p> ISO/IEC 646: ISO 7-bit coded character set - Invariant Characters set encoding. ECI Id:"\000170"</p>
*/
INVARIANT: 170,
/**
* <p> 8-bit binary data. ECI Id:"\000899"</p>
*/
BINARY: 899,
/**
* No Extended Channel Interpretation
*/
NONE: 0
};
/**
* <p>Enable checksum during generation for 1D barcodes.</p>
* <p>Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.</p>
* <p>Checksum never used: Codabar</p>
* <p>Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN</p>
* <p>Checksum always used: Rest symbologies</p>
* @enum
*/
EnableChecksum =
{
/**
* <p>
* If checksum is required by the specification - it will be attached.
* </p>
*/
DEFAULT: 0,
/**
* <p>
* Always use checksum if possible.
* </p>
*/
YES: 1,
/**
* <p>
* Do not use checksum.
* </p>
*/
NO: 2
};
/**
* Specifies the file format of the image.
* @enum
*/
BarCodeImageFormat =
{
/**
* Specifies the bitmap (BMP) image format.
*/
BMP: 0,
/**
* Specifies the Graphics Interchange Format (GIF) image format.
*/
GIF: 1,
/**
* Specifies the Joint Photographic Experts Group (JPEG) image format.
*/
JPEG: 2,
/**
* Specifies the W3C Portable Network Graphics (PNG) image format.
*/
PNG: 3,
/**
* Specifies the Tagged Image File Format (TIFF) image format.
*/
TIFF: 4,
/**
* Specifies the Tagged Image File Format (TIFF) image format in CMYK color model.
*/
TIFF_IN_CMYK: 5,
/**
* Specifies the Enhanced Metafile (EMF) image format.
*/
EMF: 6,
/**
* Specifies the Scalable Vector Graphics (SVG) image format.
*/
SVG: 7
};
/**
* Type of 2D component
* This sample shows how to create and save a GS1 Composite Bar image.
* Note that 1D codetext and 2D codetext are separated by symbol '/'
*
* @example
* let codetext = "(01)03212345678906/(21)A1B2C3D4E5F6G7H8";
* let generator = new BarcodeGenerator(EncodeTypes.GS1_COMPOSITE_BAR, codetext))
*
* generator.getParameters().getBarcode().getGS1CompositeBar().setLinearComponentType(EncodeTypes.GS1_CODE_128);
* generator.getParameters().getBarcode().getGS1CompositeBar().setTwoDComponentType(TwoDComponentType.CC_A);
*
* // Aspect ratio of 2D component
* generator.getParameters().getBarcode().getPdf417().setAspectRatio(3);
* ///
* // X-Dimension of 1D and 2D components
* generator.getParameters().getBarcode().getXDimension().setPixels(3);
* ///
* // Height of 1D component
* generator.getParameters().getBarcode().getBarHeight().setPixels(100);
* ///
* generator.save("test.png", BarcodeImageFormat.PNG);
*
*/
TwoDComponentType =
{
/**
* Auto select type of 2D component
*/
AUTO: 0,
/**
* CC-A type of 2D component. It is a structural variant of MicroPDF417
*/
CC_A: 1,
/**
* CC-B type of 2D component. It is a MicroPDF417 symbol.
*/
CC_B: 2,
/**
* CC-C type of 2D component. It is a PDF417 symbol.
*/
CC_C: 3
}
/**
* Used to tell the encoder whether to add Macro PDF417 Terminator (codeword 922) to the segment.
* Applied only for Macro PDF417.
*/
Pdf417MacroTerminator =
{
/**
* The terminator will be added automatically if the number of segments is provided<br>
* and the current segment is the last one. In other cases, the terminator will not be added.
*/
AUTO: 0,
/**
* The terminator will not be added.
*/
NONE: 1,
/**
* The terminator will be added.
*/
SET: 2
}
/**
* Encoding mode for MaxiCode barcodes.
*
* @example
* //Auto mode
* let codetext = "犬Right狗";
* let generator = new BarcodeGenerator(EncodeTypes.MAXI_CODE, codetext));
* generator.getParameters().getBarcode().getMaxiCode().setECIEncoding(ECIEncodings.UTF8);
* generator.save("test.bmp", BarcodeImageFormat.BMP);
*
* @example
* //Bytes mode
* let encodedArr = [ 0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9 ];
*
* //encode array to string
* let strBld = "";
* encodedArr.forEach(function(bval, i, bvals)
* {
* strBld += bval;
* });
* let codetext = strBld;
*
* let generator = new BarcodeGenerator(EncodeTypes.MAXI_CODE, codetext))
* generator.getParameters().getBarcode().getMaxiCode().setMaxiCodeEncodeMode(MaxiCodeEncodeMode.BYTES);
* generator.save("test.bmp", BarcodeImageFormat.BMP);
*
* @example
* //Extended codetext mode
* //create codetext
* let textBuilder = new MaxiCodeExtCodetextBuilder();
* textBuilder.addECICodetext(ECIEncodings.Win1251, "Will");
* textBuilder.addECICodetext(ECIEncodings.UTF8, "犬Right狗");
* textBuilder.addECICodetext(ECIEncodings.UTF16BE, "犬Power狗");
* textBuilder.addPlainCodetext("Plain text");
*
* // generate codetext
* let codetext = textBuilder.getExtendedCodetext();
*
* //generate
* let generator = new BarcodeGenerator(EncodeTypes.MaxiCode, codetext);
* generator.getParameters().getBarcode().getMaxiCode().setMaxiCodeEncodeMode(MaxiCodeEncodeMode.EXTENDED_CODETEXT);
* generator.getParameters().getBarcode().getMaxiCode().setTwoDDisplayText("My Text");
* generator.save("test.bmp", BarcodeImageFormat.BMP);
*/
MaxiCodeEncodeMode =
{
/**
* In Auto mode, the CodeText is encoded with maximum data compactness.
* Unicode characters are re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
* If a character is found that is not supported by the selected ECI encoding, an exception is thrown.
*/
AUTO: 0,
/**
* Encode codetext as plain bytes. If it detects any Unicode character, the character will be encoded as two bytes, lower byte first.
* @deprecated
*/
BYTES: 1,
/**
* Extended mode which supports multi ECI modes.
* It is better to use MaxiCodeExtCodetextBuilder for extended codetext generation.
* Use Display2DText property to set visible text to removing managing characters.
* ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
* All unicode characters after ECI identifier are automatically encoded into correct character codeset.
*
* @deprecated
*/
EXTENDED_CODETEXT: 2,
/**
* Extended mode which supports multi ECI modes.
* It is better to use MaxiCodeExtCodetextBuilder for extended codetext generation.
* Use Display2DText property to set visible text to removing managing characters.
* ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
* All unicode characters after ECI identifier are automatically encoded into correct character codeset.
*/
EXTENDED: 3,
/**
* In Binary mode, the CodeText is encoded with maximum data compactness.
* If a Unicode character is found, an exception is thrown.
*/
BINARY: 4,
/**
* In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
* If a character is found that is not supported by the selected ECI encoding, an exception is thrown.
* Please note that some old (pre 2006) scanners may not support this mode.
*/
ECI: 5
}
/**
* Encoding mode for MaxiCode barcodes.<br>
*
* @example
* This sample shows how to genereate MaxiCode barcodes using ComplexBarcodeGenerator
* //Mode 2 with standart second message
* let maxiCodeCodetext = new MaxiCodeCodetextMode2();
* maxiCodeCodetext.setPostalCode("524032140");
* maxiCodeCodetext.setCountryCode(056);
* maxiCodeCodetext.setServiceCategory(999);
* let maxiCodeStandartSecondMessage = new MaxiCodeStandartSecondMessage();
* maxiCodeStandartSecondMessage.setMessage("Test message");
* maxiCodeCodetext.setSecondMessage(maxiCodeStandartSecondMessage);
* let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext);
* complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
*
* @example
* //Mode 2 with structured second message
* let maxiCodeCodetext = new MaxiCodeCodetextMode2();
* maxiCodeCodetext.setPostalCode("524032140");
* maxiCodeCodetext.setCountryCode(056);
* maxiCodeCodetext.setServiceCategory(999);
* let maxiCodeStructuredSecondMessage = new MaxiCodeStructuredSecondMessage();
* maxiCodeStructuredSecondMessage.add("634 ALPHA DRIVE");
* maxiCodeStructuredSecondMessage.add("PITTSBURGH");
* maxiCodeStructuredSecondMessage.add("PA");
* maxiCodeStructuredSecondMessage.setYear(99);
* maxiCodeCodetext.setSecondMessage(maxiCodeStructuredSecondMessage);
* let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext);
* complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
*
* @example
* //Mode 3 with standart second message
* let maxiCodeCodetext = new MaxiCodeCodetextMode3();
* maxiCodeCodetext.setPostalCode("B1050");
* maxiCodeCodetext.setCountryCode(056);
* maxiCodeCodetext.setServiceCategory(999);
* let maxiCodeStandartSecondMessage = new MaxiCodeStandartSecondMessage();
* maxiCodeStandartSecondMessage.setMessage("Test message");
* maxiCodeCodetext.setSecondMessage(maxiCodeStandartSecondMessage);
* let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext);
* complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
*
* @example
* //Mode 3 with structured second message
* let maxiCodeCodetext = new MaxiCodeCodetextMode3();
* maxiCodeCodetext.setPostalCode("B1050");
* maxiCodeCodetext.setCountryCode(056);
* maxiCodeCodetext.setServiceCategory(999);
* let maxiCodeStructuredSecondMessage = new MaxiCodeStructuredSecondMessage();
* maxiCodeStructuredSecondMessage.add("634 ALPHA DRIVE");
* maxiCodeStructuredSecondMessage.add("PITTSBURGH");
* maxiCodeStructuredSecondMessage.add("PA");
* maxiCodeStructuredSecondMessage.setYear(99);
* maxiCodeCodetext.setSecondMessage(maxiCodeStructuredSecondMessage);
* let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext.getConstructedCodetext();
* complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
*
* @example
* //Mode 4
* let maxiCodeCodetext = new MaxiCodeStandardCodetext();
* maxiCodeCodetext.setMode(MaxiCodeMode.MODE_4);
* maxiCodeCodetext.setMessage("Test message");
* let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext.getConstructedCodetext();
* complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
*
* @example
* //Mode 5
* let maxiCodeCodetext = new MaxiCodeStandardCodetext();
* maxiCodeCodetext.setMode(MaxiCodeMode.MODE_5);
* maxiCodeCodetext.setMessage("Test message");
* let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext.getConstructedCodetext())
* complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
*
* @example
* //Mode 6
* let maxiCodeCodetext = new MaxiCodeStandardCodetext();
* maxiCodeCodetext.setMode(MaxiCodeMode.MODE_6);
* maxiCodeCodetext.setMessage("Test message");
* let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext.getConstructedCodetext();
* complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
*/
MaxiCodeMode =
{
/**
* Mode 2 encodes postal information in first message and data in second message.<br>
* Has 9 digits postal code (used only in USA).
*/
MODE_2: 2,
/**
* Mode 3 encodes postal information in first message and data in second message.<br>
* Has 6 alphanumeric postal code, used in the world.
*/
MODE_3: 3,
/**
* Mode 4 encodes data in first and second message, with short ECC correction.<br>
*/
MODE_4: 4,
/**
* Mode 5 encodes data in first and second message, with long ECC correction.
*/
MODE_5: 5,
/**
* Mode 6 encodes data in first and second message, with short ECC correction.<br>
* Used to encode device.
*/
MODE_6: 6
}
/**
* Encoding mode for DotCode barcodes.
*
* @example
* //Auto mode with macros
* let codetext = ""[)>\u001E05\u001DCodetextWithMacros05\u001E\u0004"";
* let generator = new BarcodeGenerator(EncodeTypes.DOT_CODE, codetext);
* generator.save("test.bmp", BarCodeImageFormat.BMP);
*
* @example
* //Auto mode
* let codetext = "犬Right狗";
* let generator = new BarcodeGenerator(EncodeTypes.DOT_CODE, codetext);
* generator.getParameters().getBarcode().getDotCode().setECIEncoding(ECIEncodings.UTF8);
* generator.save("test.bmp", BarCodeImageFormat.BMP);
*
* @example
* //Bytes mode
* let encodedArr = array( 0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9 );
* //encode array to string
* let codetext = "";
* encodedArr.forEach(function(bval, i, bvals)
* {
* codetext += bval;
* });
*
* @example
* let generator = new BarcodeGenerator(EncodeTypes.DOT_CODE, codetext);
* generator.getParameters().getBarcode().getDotCode().setDotCodeEncodeMode(DotCodeEncodeMode.BYTES);
* generator.save("test.bmp", BarCodeImageFormat.BMP);
*
* @example
* //Extended codetext mode
* //create codetext
* let textBuilder = new DotCodeExtCodetextBuilder();
* textBuilder.addFNC1FormatIdentifier();
* textBuilder.addECICodetext(ECIEncodings.Win1251, "Will");
* textBuilder.addFNC1FormatIdentifier();
* textBuilder.addECICodetext(ECIEncodings.UTF8, "犬Right狗");
* textBuilder.addFNC3SymbolSeparator();
* textBuilder.addFNC1FormatIdentifier();
* textBuilder.addECICodetext(ECIEncodings.UTF16BE, "犬Power狗");
* textBuilder.addPlainCodetext("Plain text");
* //generate codetext
* let codetext = textBuilder.getExtendedCodetext();
* //generate
* let generator = new BarcodeGenerator(EncodeTypes.DOT_CODE, codetext);
* generator.getParameters().getBarcode().getDotCode().setDotCodeEncodeMode(DotCodeEncodeMode.EXTENDED_CODETEXT);
* generator.save("test.bmp", BarCodeImageFormat.BMP);
*/
DotCodeEncodeMode =
{
/**
* In Auto mode, the CodeText is encoded with maximum data compactness.
* Unicode characters are re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
* If a character is found that is not supported by the selected ECI encoding, an exception is thrown.
* </p>
*/
AUTO: 0,
/**
* Encode codetext as plain bytes. If it detects any Unicode character, the character will be encoded as two bytes, lower byte first.
* @deprecated
*/
BYTES: 1,
/**
* Extended mode which supports multi ECI modes.
* It is better to use DotCodeExtCodetextBuilder for extended codetext generation.
* Use Display2DText property to set visible text to removing managing characters.
* ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
* All unicode characters after ECI identifier are automatically encoded into correct character codeset.
* @deprecated
*/
EXTENDED_CODETEXT: 2,
/**
* In Binary mode, the CodeText is encoded with maximum data compactness.
* If a Unicode character is found, an exception is thrown.
*/
BINARY: 3,
/**
* In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
* If a character is found that is not supported by the selected ECI encoding, an exception is thrown.
* Please note that some old (pre 2006) scanners may not support this mode.
*/
ECI: 4,
/**
* Extended mode which supports multi ECI modes.
* It is better to use DotCodeExtCodetextBuilder for extended codetext generation.
* Use Display2DText property to set visible text to removing managing characters.
* ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
* All unicode characters after ECI identifier are automatically encoded into correct character codeset.
*/
EXTENDED: 5
}
/**
* Pdf417 barcode encode mode
*/
Pdf417EncodeMode =
{
/**
*
* In Auto mode, the CodeText is encoded with maximum data compactness.
* Unicode characters are re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
* If a character is found that is not supported by the selected ECI encoding, an exception is thrown.
*/
AUTO: 0,
/**
* In Binary mode, the CodeText is encoded with maximum data compactness.
* If a Unicode character is found, an exception is thrown.
*/
BINARY: 1,
/**
* In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
* If a character is found that is not supported by the selected ECI encoding, an exception is thrown.
* Please note that some old (pre 2006) scanners may not support this mode.
*/
ECI: 2,
/**
* Extended mode which supports multi ECI modes.
* It is better to use Pdf417ExtCodetextBuilder for extended codetext generation.
* Use Display2DText property to set visible text to removing managing characters.
* ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
* All unicode characters after ECI identifier are automatically encoded into correct character codeset.
*/
EXTENDED: 3
}
/**
* <p>
* Encoding mode for Code128 barcodes.
* {@code Code 128} specification.
* </p><p><hr><blockquote><pre>
* Thos code demonstrates how to generate code 128 with different encodings
* <pre>
*
* //Generate code 128 with ISO 15417 encoding
*
* let generator = new BarcodeGenerator(EncodeTypes.CODE_128, "ABCD1234567890");
* generator.getParameters().getBarcode().getCode128().setCode128EncodeMode(Code128EncodeMode.AUTO);
* generator.save("d:\\code128Auto.png", BarCodeImageFormat.PNG);
*
* //Generate code 128 only with Codeset A encoding
* let generator = new BarcodeGenerator(EncodeTypes.CODE_128, "ABCD1234567890");
* generator.getParameters().getBarcode().getCode128().setCode128EncodeMode(Code128EncodeMode.CODE_A);
* generator.save("d:\\code128CodeA.png", BarCodeImageFormat.PNG);
* </pre>
* </pre></blockquote></hr></p>
*/
Code128EncodeMode =
{
/**
* <p>
* Encode codetext in classic ISO 15417 mode. The mode should be used in all ordinary cases.
* </p>
*/
AUTO: 0,
/**
* <p>
* Encode codetext only in 128A codeset.
* </p>
*/
CODE_A: 1,
/**
* <p>
* Encode codetext only in 128B codeset.
* </p>
*/
CODE_B: 2,
/**
* <p>
* Encode codetext only in 128C codeset.
* </p>
*/
CODE_C: 4,
/**
* <p>
* Encode codetext only in 128A and 128B codesets.
* </p>
*/
CODE_AB: 3,
/**
* <p>
* Encode codetext only in 128A and 128C codesets.
* </p>
*/
CODE_AC: 5,
/**
* <p>
* Encode codetext only in 128B and 128C codesets.
* </p>
*/
CODE_BC: 6
}
/**
* <p>
* Version of Han Xin Code.
* From Version01 - 23 x 23 modules to Version84 - 189 x 189 modules, increasing in steps of 2 modules per side.
* </p>
*/
HanXinVersion =
{
/**
* <p>
* Specifies to automatically pick up the best version.
* This is default value.
* </p>
*/
AUTO: 0,
/**
* <p>
* Specifies version 1 with 23 x 23 modules.
* </p>
*/
VERSION_01: 1,
/**
* <p>
* Specifies version 2 with 25 x 25 modules.
* </p>
*/
VERSION_02: 2,
/**
* <p>
* Specifies version 3 with 27 x 27 modules.
* </p>
*/
VERSION_03: 3,
/**
* <p>
* Specifies version 4 with 29 x 29 modules.
* </p>
*/
VERSION_04: 4,
/**
* <p>
* Specifies version 5 with 31 x 31 modules.
* </p>
*/
VERSION_05: 5,
/**
* <p>
* Specifies version 6 with 33 x 33 modules.
* </p>
*/
VERSION_06: 6,
/**
* <p>
* Specifies version 7 with 35 x 35 modules.
* </p>
*/
VERSION_07: 7,
/**
* <p>
* Specifies version 8 with 37 x 37 modules.
* </p>
*/
VERSION_08: 8,
/**
* <p>
* Specifies version 9 with 39 x 39 modules.
* </p>
*/
VERSION_09: 9,
/**
* <p>
* Specifies version 10 with 41 x 41 modules.
* </p>
*/
VERSION_10: 10,
/**
* <p>
* Specifies version 11 with 43 x 43 modules.
* </p>
*/
VERSION_11: 11,
/**
* <p>
* Specifies version 12 with 45 x 45 modules.
* </p>
*/
VERSION_12: 12,
/**
* <p>
* Specifies version 13 with 47 x 47 modules.
* </p>
*/
VERSION_13: 13,
/**
* <p>
* Specifies version 14 with 49 x 49 modules.
* </p>
*/
VERSION_14: 14,
/**
* <p>
* Specifies version 15 with 51 x 51 modules.
* </p>
*/
VERSION_15: 15,
/**
* <p>
* Specifies version 16 with 53 x 53 modules.
* </p>
*/
VERSION_16: 16,
/**
* <p>
* Specifies version 17 with 55 x 55 modules.
* </p>
*/
VERSION_17: 17,
/**
* <p>
* Specifies version 18 with 57 x 57 modules.
* </p>
*/
VERSION_18: 18,
/**
* <p>
* Specifies version 19 with 59 x 59 modules.
* </p>
*/
VERSION_19: 19,
/**
* <p>
* Specifies version 20 with 61 x 61 modules.
* </p>
*/
VERSION_20: 20,
/**
* <p>
* Specifies version 21 with 63 x 63 modules.
* </p>
*/
VERSION_21: 21,
/**
* <p>
* Specifies version 22 with 65 x 65 modules.
* </p>
*/
VERSION_22: 22,
/**
* <p>
* Specifies version 23 with 67 x 67 modules.
* </p>
*/
VERSION_23: 23,
/**
* <p>
* Specifies version 24 with 69 x 69 modules.
* </p>
*/
VERSION_24: 24,
/**
* <p>
* Specifies version 25 with 71 x 71 modules.
* </p>
*/
VERSION_25: 25,
/**
* <p>
* Specifies version 26 with 73 x 73 modules.
* </p>
*/
VERSION_26: 26,
/**
* <p>
* Specifies version 27 with 75 x 75 modules.
* </p>
*/
VERSION_27: 27,
/**
* <p>
* Specifies version 28 with 77 x 77 modules.
* </p>
*/
VERSION_28: 28,
/**
* <p>
* Specifies version 29 with 79 x 79 modules.
* </p>
*/
VERSION_29: 29,
/**
* <p>
* Specifies version 30 with 81 x 81 modules.
* </p>
*/
VERSION_30: 30,
/**
* <p>
* Specifies version 31 with 83 x 83 modules.
* </p>
*/
VERSION_31: 31,
/**
* <p>
* Specifies version 32 with 85 x 85 modules.
* </p>
*/
VERSION_32: 32,
/**
* <p>
* Specifies version 33 with 87 x 87 modules.
* </p>
*/
VERSION_33: 33,
/**
* <p>
* Specifies version 34 with 89 x 89 modules.
* </p>
*/
VERSION_34: 34,
/**
* <p>
* Specifies version 35 with 91 x 91 modules.
* </p>
*/
VERSION_35: 35,
/**
* <p>
* Specifies version 36 with 93 x 93 modules.
* </p>
*/
VERSION_36: 36,
/**
* <p>
* Specifies version 37 with 95 x 95 modules.
* </p>
*/
VERSION_37: 37,
/**
* <p>
* Specifies version 38 with 97 x 97 modules.
* </p>
*/
VERSION_38: 38,
/**
* <p>
* Specifies version 39 with 99 x 99 modules.
* </p>
*/
VERSION_39: 39,
/**
* <p>
* Specifies version 40 with 101 x 101 modules.
* </p>
*/
VERSION_40: 40,
/**
* <p>
* Specifies version 41 with 103 x 103 modules.
* </p>
*/
VERSION_41: 41,
/**
* <p>
* Specifies version 42 with 105 x 105 modules.
* </p>
*/
VERSION_42: 42,
/**
* <p>
* Specifies version 43 with 107 x 107 modules.
* </p>
*/
VERSION_43: 43,
/**
* <p>
* Specifies version 44 with 109 x 109 modules.
* </p>
*/
VERSION_44: 44,
/**
* <p>
* Specifies version 45 with 111 x 111 modules.
* </p>
*/
VERSION_45: 45,
/**
* <p>
* Specifies version 46 with 113 x 113 modules.
* </p>
*/
VERSION_46: 46,
/**
* <p>
* Specifies version 47 with 115 x 115 modules.
* </p>
*/
VERSION_47: 47,
/**
* <p>
* Specifies version 48 with 117 x 117 modules.
* </p>
*/
VERSION_48: 48,
/**
* <p>
* Specifies version 49 with 119 x 119 modules.
* </p>
*/
VERSION_49: 49,
/**
* <p>
* Specifies version 50 with 121 x 121 modules.
* </p>
*/
VERSION_50: 50,
/**
* <p>
* Specifies version 51 with 123 x 123 modules.
* </p>
*/
VERSION_51: 51,
/**
* <p>
* Specifies version 52 with 125 x 125 modules.
* </p>
*/
VERSION_52: 52,
/**
* <p>
* Specifies version 53 with 127 x 127 modules.
* </p>
*/
VERSION_53: 53,
/**
* <p>
* Specifies version 54 with 129 x 129 modules.
* </p>
*/
VERSION_54: 54,
/**
* <p>
* Specifies version 55 with 131 x 131 modules.
* </p>
*/
VERSION_55: 55,
/**
* <p>
* Specifies version 56 with 133 x 133 modules.
* </p>
*/
VERSION_56: 56,
/**
* <p>
* Specifies version 57 with 135 x 135 modules.
* </p>
*/
VERSION_57: 57,
/**
* <p>
* Specifies version 58 with 137 x 137 modules.
* </p>
*/
VERSION_58: 58,
/**
* <p>
* Specifies version 59 with 139 x 139 modules.
* </p>
*/
VERSION_59: 59,
/**
* <p>
* Specifies version 60 with 141 x 141 modules.
* </p>
*/
VERSION_60: 60,
/**
* <p>
* Specifies version 61 with 143 x 143 modules.
* </p>
*/
VERSION_61: 61,
/**
* <p>
* Specifies version 62 with 145 x 145 modules.
* </p>
*/
VERSION_62: 62,
/**
* <p>
* Specifies version 63 with 147 x 147 modules.
* </p>
*/
VERSION_63: 63,
/**
* <p>
* Specifies version 64 with 149 x 149 modules.
* </p>
*/
VERSION_64: 64,
/**
* <p>
* Specifies version 65 with 151 x 151 modules.
* </p>
*/
VERSION_65: 65,
/**
* <p>
* Specifies version 66 with 153 x 153 modules.
* </p>
*/
VERSION_66: 66,
/**
* <p>
* Specifies version 67 with 155 x 155 modules.
* </p>
*/
VERSION_67: 67,
/**
* <p>
* Specifies version 68 with 157 x 157 modules.
* </p>
*/
VERSION_68: 68,
/**
* <p>
* Specifies version 69 with 159 x 159 modules.
* </p>
*/
VERSION_69: 69,
/**
* <p>
* Specifies version 70 with 161 x 161 modules.
* </p>
*/
VERSION_70: 70,
/**
* <p>
* Specifies version 71 with 163 x 163 modules.
* </p>
*/
VERSION_71: 71,
/**
* <p>
* Specifies version 72 with 165 x 165 modules.
* </p>
*/
VERSION_72: 72,
/**
* <p>
* Specifies version 73 with 167 x 167 modules.
* </p>
*/
VERSION_73: 73,
/**
* <p>
* Specifies version 74 with 169 x 169 modules.
* </p>
*/
VERSION_74: 74,
/**
* <p>
* Specifies version 75 with 171 x 171 modules.
* </p>
*/
VERSION_75: 75,
/**
* <p>
* Specifies version 76 with 173 x 173 modules.
* </p>
*/
VERSION_76: 76,
/**
* <p>
* Specifies version 77 with 175 x 175 modules.
* </p>
*/
VERSION_77: 77,
/**
* <p>
* Specifies version 78 with 177 x 177 modules.
* </p>
*/
VERSION_78: 78,
/**
* <p>
* Specifies version 79 with 179 x 179 modules.
* </p>
*/
VERSION_79: 79,
/**
* <p>
* Specifies version 80 with 181 x 181 modules.
* </p>
*/
VERSION_80: 80,
/**
* <p>
* Specifies version 81 with 183 x 183 modules.
* </p>
*/
VERSION_81: 81,
/**
* <p>
* Specifies version 82 with 185 x 185 modules.
* </p>
*/
VERSION_82: 82,
/**
* <p>
* Specifies version 83 with 187 x 187 modules.
* </p>
*/
VERSION_83: 83,
/**
* <p>
* Specifies version 84 with 189 x 189 modules.
* </p>
*/
VERSION_84: 84,
}
/**
* <p>
* Level of Reed-Solomon error correction. From low to high: L1, L2, L3, L4.
* </p>
*/
HanXinErrorLevel =
{
/**
* <p>
* Allows recovery of 8% of the code text
* </p>
*/
L1: 0,
/**
* <p>
* Allows recovery of 15% of the code text
* </p>
*/
L2: 1,
/**
* <p>
* Allows recovery of 23% of the code text
* </p>
*/
L3: 2,
/**
* <p>
* Allows recovery of 30% of the code text
* </p>
*/
L4: 3
}
/**
* <p>
* Han Xin Code encoding mode. It is recommended to use Auto with ASCII / Chinese characters or Unicode for Unicode characters.
* </p><p><hr><blockquote><pre>
* <pre>
* @example
* // Auto mode
* let codetext = "1234567890ABCDEFGabcdefg,Han Xin Code";
* let generator = new BarcodeGenerator(EncodeTypes.HAN_XIN, codetext);
* generator.save("test.bmp", BarcodeImageFormat.BMP);
*
* @example
* // Bytes mode
* let encodedArr = [0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9];
*
* //encode array to string
* let codetext = "";
* for (int i = 0; i <encodedArr.length; i++)
* {
* let bval = String.fromCharCode(encodedArr[i]);
* codetext += bval;
* }
*
* let generator = new BarcodeGenerator(EncodeTypes.HAN_XIN, codetext);
* generator.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(HanXinEncodeMode.BYTES);
* generator.save("test.bmp", BarcodeImageFormat.BMP);
*
* @example
* // ECI mode
* let codetext = "ΑΒΓΔΕ";
* let generator = new BarcodeGenerator(EncodeTypes.HAN_XIN, codetext);
* generator.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(HanXinEncodeMode.ECI);
* generator.getParameters().getBarcode().getHanXin().setHanXinECIEncoding(ECIEncodings.ISO_8859_7);
* generator.save("test.bmp", BarcodeImageFormat.BMP);
*
* @example
* // URI mode
* let codetext = "https://www.test.com/%BC%DE%%%ab/search=test";
* generator = new BarcodeGenerator(EncodeTypes.HAN_XIN, codetext);
* generator.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(HanXinEncodeMode.URI);
* generator.save("test.bmp", BarcodeImageFormat.BMP);
*
* // Extended mode - TBD
* </pre>
* </pre></blockquote></hr></p>
*/
HanXinEncodeMode =
{
/**
* <p>
* Sequence of Numeric, Text, ECI, Binary Bytes and 4 GB18030 modes changing automatically.
* </p>
*/
AUTO: 0,
/**
* <p>
* Binary byte mode encodes binary data in any form and encodes them in their binary byte. Every byte in
* Binary Byte mode is represented by 8 bits.
* </p>
*/
BINARY: 1,
/**
* <p>
* Extended Channel Interpretation (ECI) mode
* </p>
*/
ECI: 2,
/**
* <p>
* Unicode mode designs a way to represent any text data reference to UTF8 encoding/charset in Han Xin Code.
* </p>
*/
UNICODE: 3,
/**
* <p>
* URI mode indicates the data represented in Han Xin Code is Uniform Resource Identifier (URI)
* reference to RFC 3986.
* </p>
*/
URI: 4,
/**
* <p>
* Extended mode will allow more flexible combinations of other modes, this mode is currently not implemented.
* </p>
*/
EXTENDED: 5
}
/**
* <p>
* Specify the type of the ECC to encode.
* </p>
*/
DataMatrixVersion =
{
/**
* <p>
* Specifies to automatically pick up the smallest size for DataMatrix.
* This is default value.
* </p>
*/
AUTO: 0,
/**
* <p>
* Instructs to get symbol sizes from Rows And Columns parameters. Note that DataMatrix does not support
* custom rows and columns numbers. This option is not recommended to use.
* </p>
*/
ROWS_COLUMNS: 1,
/**
* <p>
* Specifies size of 9 x 9 modules for ECC000 type.
* </p>
*/
ECC000_9x9: 2,
/**
* <p>
* Specifies size of 11 x 11 modules for ECC000-ECC050 types.
* </p>
*/
ECC000_050_11x11: 3,
/**
* <p>
* Specifies size of 13 x 13 modules for ECC000-ECC100 types.
* </p>
*/
ECC000_100_13x13: 4,
/**
* <p>
* Specifies size of 15 x 15 modules for ECC000-ECC100 types.
* </p>
*/
ECC000_100_15x15: 5,
/**
* <p>
* Specifies size of 17 x 17 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_17x17: 6,
/**
* <p>
* Specifies size of 19 x 19 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_19x19: 7,
/**
* <p>
* Specifies size of 21 x 21 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_21x21: 8,
/**
* <p>
* Specifies size of 23 x 23 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_23x23: 9,
/**
* <p>
* Specifies size of 25 x 25 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_25x25: 10,
/**
* <p>
* Specifies size of 27 x 27 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_27x27: 11,
/**
* <p>
* Specifies size of 29 x 29 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_29x29: 12,
/**
* <p>
* Specifies size of 31 x 31 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_31x31: 13,
/**
* <p>
* Specifies size of 33 x 33 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_33x33: 14,
/**
* <p>
* Specifies size of 35 x 35 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_35x35: 15,
/**
* <p>
* Specifies size of 37 x 37 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_37x37: 16,
/**
* <p>
* Specifies size of 39 x 39 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_39x39: 17,
/**
* <p>
* Specifies size of 41 x 41 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_41x41: 18,
/**
* <p>
* Specifies size of 43 x 43 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_43x43: 19,
/**
* <p>
* Specifies size of 45 x 45 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_45x45: 20,
/**
* <p>
* Specifies size of 47 x 47 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_47x47: 21,
/**
* <p>
* Specifies size of 49 x 49 modules for ECC000-ECC140 types.
* </p>
*/
ECC000_140_49x49: 22,
/**
* <p>
* Specifies size of 10 x 10 modules for ECC200 type.
* </p>
*/
ECC200_10x10: 23,
/**
* <p>
* Specifies size of 12 x 12 modules for ECC200 type.
* </p>
*/
ECC200_12x12: 24,
/**
* <p>
* Specifies size of 14 x 14 modules for ECC200 type.
* </p>
*/
ECC200_14x14: 25,
/**
* <p>
* Specifies size of 16 x 16 modules for ECC200 type.
* </p>
*/
ECC200_16x16: 26,
/**
* <p>
* Specifies size of 18 x 18 modules for ECC200 type.
* </p>
*/
ECC200_18x18: 27,
/**
* <p>
* Specifies size of 20 x 20 modules for ECC200 type.
* </p>
*/
ECC200_20x20: 28,
/**
* <p>
* Specifies size of 22 x 22 modules for ECC200 type.
* </p>
*/
ECC200_22x22: 29,
/**
* <p>
* Specifies size of 24 x 24 modules for ECC200 type.
* </p>
*/
ECC200_24x24: 30,
/**
* <p>
* Specifies size of 26 x 26 modules for ECC200 type.
* </p>
*/
ECC200_26x26: 31,
/**
* <p>
* Specifies size of 32 x 32 modules for ECC200 type.
* </p>
*/
ECC200_32x32: 32,
/**
* <p>
* Specifies size of 36 x 36 modules for ECC200 type.
* </p>
*/
ECC200_36x36: 33,
/**
* <p>
* Specifies size of 40 x 40 modules for ECC200 type.
* </p>
*/
ECC200_40x40: 34,
/**
* <p>
* Specifies size of 44 x 44 modules for ECC200 type.
* </p>
*/
ECC200_44x44: 35,
/**
* <p>
* Specifies size of 48 x 48 modules for ECC200 type.
* </p>
*/
ECC200_48x48: 36,
/**
* <p>
* Specifies size of 52 x 52 modules for ECC200 type.
* </p>
*/
ECC200_52x52: 37,
/**
* <p>
* Specifies size of 64 x 64 modules for ECC200 type.
* </p>
*/
ECC200_64x64: 38,
/**
* <p>
* Specifies size of 72 x 72 modules for ECC200 type.
* </p>
*/
ECC200_72x72: 39,
/**
* <p>
* Specifies size of 80 x 80 modules for ECC200 type.
* </p>
*/
ECC200_80x80: 40,
/**
* <p>
* Specifies size of 88 x 88 modules for ECC200 type.
* </p>
*/
ECC200_88x88: 41,
/**
* <p>
* Specifies size of 96 x 96 modules for ECC200 type.
* </p>
*/
ECC200_96x96: 42,
/**
* <p>
* Specifies size of 104 x 104 modules for ECC200 type.
* </p>
*/
ECC200_104x104: 43,
/**
* <p>
* Specifies size of 120 x 120 modules for ECC200 type.
* </p>
*/
ECC200_120x120: 44,
/**
* <p>
* Specifies size of 132 x 132 modules for ECC200 type.
* </p>
*/
ECC200_132x132: 45,
/**
* <p>
* Specifies size of 144 x 144 modules for ECC200 type.
* </p>
*/
ECC200_144x144: 46,
/**
* <p>
* Specifies size of 8 x 18 modules for ECC200 type.
* </p>
*/
ECC200_8x18: 47,
/**
* <p>
* Specifies size of 8 x 32 modules for ECC200 type.
* </p>
*/
ECC200_8x32: 48,
/**
* <p>
* Specifies size of 12 x 26 modules for ECC200 type.
* </p>
*/
ECC200_12x26: 49,
/**
* <p>
* Specifies size of 12 x 36 modules for ECC200 type.
* </p>
*/
ECC200_12x36: 50,
/**
* <p>
* Specifies size of 16 x 36 modules for ECC200 type.
* </p>
*/
ECC200_16x36: 51,
/**
* <p>
* Specifies size of 16 x 48 modules for ECC200 type.
* </p>
*/
ECC200_16x48: 52,
/**
* <p>
* Specifies size of 8 x 48 modules for DMRE barcodes.
* </p>
*/
DMRE_8x48: 53,
/**
* <p>
* Specifies size of 8 x 64 modules for DMRE barcodes.
* </p>
*/
DMRE_8x64: 54,
/**
* <p>
* Specifies size of 8 x 80 modules for DMRE barcodes.
* </p>
*/
DMRE_8x80: 55,
/**
* <p>
* Specifies size of 8 x 96 modules for DMRE barcodes.
* </p>
*/
DMRE_8x96: 56,
/**
* <p>
* Specifies size of 8 x 120 modules for DMRE barcodes.
* </p>
*/
DMRE_8x120: 57,
/**
* <p>
* Specifies size of 8 x 144 modules for DMRE barcodes.
* </p>
*/
DMRE_8x144: 58,
/**
* <p>
* Specifies size of 12 x 64 modules for DMRE barcodes.
* </p>
*/
DMRE_12x64: 59,
/**
* <p>
* Specifies size of 12 x 88 modules for DMRE barcodes.
* </p>
*/
DMRE_12x88: 60,
/**
* <p>
* Specifies size of 16 x 64 modules for DMRE barcodes.
* </p>
*/
DMRE_16x64: 61,
/**
* <p>
* Specifies size of 20 x 36 modules for DMRE barcodes.
* </p>
*/
DMRE_20x36: 62,
/**
* <p>
* Specifies size of 20 x 44 modules for DMRE barcodes.
* </p>
*/
DMRE_20x44: 63,
/**
* <p>
* Specifies size of 20 x 64 modules for DMRE barcodes.
* </p>
*/
DMRE_20x64: 64,
/**
* <p>
* Specifies size of 22 x 48 modules for DMRE barcodes.
* </p>
*/
DMRE_22x48: 65,
/**
* <p>
* Specifies size of 24 x 48 modules for DMRE barcodes.
* </p>
*/
DMRE_24x48: 66,
/**
* <p>
* Specifies size of 24 x 64 modules for DMRE barcodes.
* </p>
*/
DMRE_24x64: 67,
/**
* <p>
* Specifies size of 26 x 40 modules for DMRE barcodes.
* </p>
*/
DMRE_26x40: 68,
/**
* <p>
* Specifies size of 26 x 48 modules for DMRE barcodes.
* </p>
*/
DMRE_26x48: 69,
/**
* <p>
* Specifies size of 26 x 64 modules for DMRE barcodes.
* </p>
*/
DMRE_26x64: 70
}
/**
* <p>
* Encoding mode for Aztec barcodes.
* </p><p><hr><blockquote><pre>
* <pre>
*
* @example
* //Auto mode
* let codetext = "犬Right狗";
* let generator = new BarcodeGenerator(EncodeTypes.AZTEC, codetext);
* generator.getParameters().getBarcode().getAztec().setECIEncoding(ECIEncodings.UTF_8);
* generator.save("test.bmp");
*
* @example
* //Bytes mode
* let encodedArr = [ 0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9 ];
* //encode array to string
* let strBld = "";
* for(let i = 0; i < encodedArr; i++)
* {
* byte bval = encodedArr[i]
* strBld.append(String.fromCharCode(bval));
* }
* let codetext = strBld;
* let generator = new BarcodeGenerator(EncodeTypes.AZTEC, codetext);
* generator.getParameters().getBarcode().getAztec().setAztecEncodeMode(AztecEncodeMode.BYTES);
* generator.save("test.bmp", BarcodeImageFormat.PNG);
*
* @example
* //Extended codetext mode
* //create codetext
* let textBuilder = new AztecExtCodetextBuilder();
* textBuilder.addECICodetext(ECIEncodings.Win1251, "Will");
* textBuilder.addECICodetext(ECIEncodings.UTF8, "犬Right狗");
* textBuilder.addECICodetext(ECIEncodings.UTF16BE, "犬Power狗");
* textBuilder.addPlainCodetext("Plain text");
* //generate codetext
* let codetext = textBuilder.getExtendedCodetext();
* //generate
* let generator = new BarcodeGenerator(EncodeTypes.AZTEC, codetext);
* generator.getParameters().getBarcode().getAztec().setAztecEncodeMode(AztecEncodeMode.EXTENDED_CODETEXT);
* generator.getParameters().getBarcode().getCodeTextParameters().setTwoDDisplayText("My Text");
* generator.save("test.bmp", BarcodeImageFormat.PNG);
*
* </pre>
* </pre></blockquote></hr></p>
*/
AztecEncodeMode =
{
/**
* In Auto mode, the CodeText is encoded with maximum data compactness.
* Unicode characters are re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
* If a character is found that is not supported by the selected ECI encoding, an exception is thrown.
*/
AUTO: 0,
/**
* Encode codetext as plain bytes. If it detects any Unicode character, the character will be encoded as two bytes, lower byte first.
* @deprecated
*/
BYTES: 1,
/**
* Extended mode which supports multi ECI modes.
* It is better to use AztecExtCodetextBuilder for extended codetext generation.
* Use Display2DText property to set visible text to removing managing characters.
* ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
* All unicode characters after ECI identifier are automatically encoded into correct character codeset.
* @deprecated
*/
EXTENDED_CODETEXT: 2,
/**
* Extended mode which supports multi ECI modes.
* It is better to use AztecExtCodetextBuilder for extended codetext generation.
* Use Display2DText property to set visible text to removing managing characters.
* ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
* All unicode characters after ECI identifier are automatically encoded into correct character codeset.
*/
EXTENDED: 3,
/**
* In Binary mode, the CodeText is encoded with maximum data compactness.
* If a Unicode character is found, an exception is thrown.
*/
BINARY: 4,
/**
* In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.
* If a character is found that is not supported by the selected ECI encoding, an exception is thrown.
* Please note that some old (pre 2006) scanners may not support this mode.
*/
ECI: 5
}
/**
* Version of MicroQR Code.
* From M1 to M4.
* @enum
*/
MicroQRVersion =
{
/**
* Specifies to automatically pick up the best version for MicroQR.
* This is default value.
*/
AUTO: 0,
/**
* <p>
* Specifies version M1 for Micro QR with 11 x 11 modules.
* </p>
*/
M1: 1,
/**
* <p>
* Specifies version M2 for Micro QR with 13 x 13 modules.
* </p>
*/
M2: 2,
/**
* <p>
* Specifies version M3 for Micro QR with 15 x 15 modules.
* </p>
*/
M3: 3,
/**
* <p>
* Specifies version M4 for Micro QR with 17 x 17 modules.
* </p>
*/
M4: 4
}
/**
* <p>
* Version of RectMicroQR Code.
* From version R7x43 to version R17x139.
* </p>
* @enum
*/
RectMicroQRVersion =
{
/**
* <p>
* Specifies to automatically pick up the best version for RectMicroQR.
* This is default value.
* </p>
*/
AUTO: 0,
/**
* <p>
* Specifies version with 7 x 43 modules.
* </p>
*/
R7x43: 1,
/**
* <p>
* Specifies version with 7 x 59 modules.
* </p>
*/
R7x59: 2,
/**
* <p>
* Specifies version with 7 x 77 modules.
* </p>
*/
R7x77: 3,
/**
* <p>
* Specifies version with 7 x 99 modules.
* </p>
*/
R7x99: 4,
/**
* <p>
* Specifies version with 7 x 139 modules.
* </p>
*/
R7x139: 5,
/**
* <p>
* Specifies version with 9 x 43 modules.
* </p>
*/
R9x43: 6,
/**
* <p>
* Specifies version with 9 x 59 modules.
* </p>
*/
R9x59: 7,
/**
* <p>
* Specifies version with 9 x 77 modules.
* </p>
*/
R9x77: 8,
/**
* <p>
* Specifies version with 9 x 99 modules.
* </p>
*/
R9x99: 9,
/**
* <p>
* Specifies version with 9 x 139 modules.
* </p>
*/
R9x139: 10,
/**
* <p>
* Specifies version with 11 x 27 modules.
* </p>
*/
R11x27: 11,
/**
* <p>
* Specifies version with 11 x 43 modules.
* </p>
*/
R11x43: 12,
/**
* <p>
* Specifies version with 11 x 59 modules.
* </p>
*/
R11x59: 13,
/**
* <p>
* Specifies version with 11 x 77 modules.
* </p>
*/
R11x77: 14,
/**
* <p>
* Specifies version with 11 x 99 modules.
* </p>
*/
R11x99: 15,
/**
* <p>
* Specifies version with 11 x 139 modules.
* </p>
*/
R11x139: 16,
/**
* <p>
* Specifies version with 13 x 27 modules.
* </p>
*/
R13x27: 17,
/**
* <p>
* Specifies version with 13 x 43 modules.
* </p>
*/
R13x43: 18,
/**
* <p>
* Specifies version with 13 x 59 modules.
* </p>
*/
R13x59: 19,
/**
* <p>
* Specifies version with 13 x 77 modules.
* </p>
*/
R13x77: 20,
/**
* <p>
* Specifies version with 13 x 99 modules.
* </p>
*/
R13x99: 21,
/**
* <p>
* Specifies version with 13 x 139 modules.
* </p>
*/
R13x139: 22,
/**
* <p>
* Specifies version with 15 x 43 modules.
* </p>
*/
R15x43: 23,
/**
* <p>
* Specifies version with 15 x 59 modules.
* </p>
*/
R15x59: 24,
/**
* <p>
* Specifies version with 15 x 77 modules.
* </p>
*/
R15x77: 25,
/**
* <p>
* Specifies version with 15 x 99 modules.
* </p>
*/
R15x99: 26,
/**
* <p>
* Specifies version with 15 x 139 modules.
* </p>
*/
R15x139: 27,
/**
* <p>
* Specifies version with 17 x 43 modules.
* </p>
*/
R17x43: 28,
/**
* <p>
* Specifies version with 17 x 59 modules.
* </p>
*/
R17x59: 29,
/**
* <p>
* Specifies version with 17 x 77 modules.
* </p>
*/
R17x77: 30,
/**
* <p>
* Specifies version with 17 x 99 modules.
* </p>
*/
R17x99: 31,
/**
* <p>
* Specifies version with 17 x 139 modules.
* </p>
*/
R17x139: 32
}
/**
* <p>
* Possible modes for filling color in svg file, RGB is default and supported by SVG 1.1.
* RGBA, HSL, HSLA is allowed in SVG 2.0 standard.
* Even in RGB opacity will be set through "fill-opacity" parameter
* </p>
*/
SvgColorMode =
{
/**
* <p>
* RGB mode, example: fill="#ff5511" fill-opacity="0.73". Default mode.
* </p>
*/
RGB: 0,
/**
* <p>
* RGBA mode, example: fill="rgba(255, 85, 17, 0.73)"
* </p>
*/
RGBA: 1,
/**
* <p>
* HSL mode, example: fill="hsl(17, 100%, 53%)" fill-opacity="0.73"
* </p>
*/
HSL: 2,
/**
* <p>
* HSLA mode, example: fill="hsla(30, 50%, 70%, 0.8)"
* </p>
*/
HSLA: 3
}
module.exports = {
BarcodeGenerator,
EncodeTypes,
BarcodeParameters,
BaseGenerationParameters,
BorderParameters,
CaptionParameters,
BorderDashStyle,
AutoSizeMode,
PatchFormat,
PatchCodeParameters,
DataMatrixEncodeMode,
ECIEncodings,
QrExtCodetextBuilder,
ExtCodetextBuilder,
Unit,
Padding,
CodetextParameters,
BarCodeImageFormat,
PostalParameters,
AustralianPostParameters,
CodablockParameters,
DataBarParameters,
DataMatrixParameters,
Code16KParameters,
DotCodeParameters,
ITFParameters,
QrParameters,
Pdf417Parameters,
SupplementParameters,
MaxiCodeParameters,
AztecParameters,
CodabarParameters,
CouponParameters,
FontUnit,
QrStructuredAppendParameters,
Code128Parameters,
BarcodeClassifications,
FontStyle,
CodabarSymbol,
ITF14BorderType,
QREncodeMode,
DataMatrixEccType,
QRVersion,
AztecSymbolMode,
Pdf417ErrorLevel,
Pdf417CompactionMode,
QRErrorLevel,
QREncodeType,
CodabarChecksumMode,
CodeLocation,
FontMode,
TextAlignment,
GraphicsUnit,
MacroCharacter,
EnableChecksum,
TwoDComponentType,
GS1CompositeBarParameters,
Pdf417MacroTerminator,
MaxiCodeExtCodetextBuilder,
DotCodeExtCodetextBuilder,
DotCodeEncodeMode,
HanXinEncodeMode,
HanXinErrorLevel,
HanXinVersion,
Code128EncodeMode,
HanXinParameters,
DataMatrixVersion,
DataMatrixExtCodetextBuilder,
HanXinExtCodetextBuilder,
AztecEncodeMode,
AztecExtCodetextBuilder,
MicroQRVersion,
RectMicroQRVersion,
ImageParameters,
SvgParameters,
HslaColor,
SvgColorMode
};