Class BarcodeParameters
- java.lang.Object
-
- com.aspose.barcode.generation.BarcodeParameters
-
public class BarcodeParameters extends java.lang.Object
Barcode generation parameters.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description float
getAspectRatio()
Deprecated.AustralianPostParameters
getAustralianPost()
AustralianPost barcode parameters.AutoSizeMode
getAutoSizeMode()
Deprecated."This method is obsolete.AztecParameters
getAztec()
Aztec parameters.int
getBackColor()
Deprecated.Unit
getBarCodeHeight()
Deprecated."This method is obsolete.BaseEncodeType
getBarcodeType()
Deprecated.Unit
getBarCodeWidth()
Deprecated."This method is obsolete.int
getBarColor()
Bars color.Unit
getBarHeight()
Height of 1D barcodes' bars inUnit
value.Unit
getBarWidthReduction()
Get bars reduction value that is used to compensate ink spread while printing.int
getCalculatedBarCodeWidth()
boolean
getChecksumAlwaysShow()
Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.CodabarParameters
getCodabar()
Codabar parameters.CodablockParameters
getCodablock()
Codablock parameters.Code16KParameters
getCode16K()
Code16K parameters.java.lang.String
getCodeText()
CodetextParameters
getCodeTextParameters()
Codetext parameters.int
getColumns()
Deprecated.com.aspose.barcode.generation.ComplexBarcode
getComplexBarcode()
Deprecated.CouponParameters
getCoupon()
Coupon parameters.DataBarParameters
getDataBar()
Databar parameters.DataMatrixParameters
getDataMatrix()
DataMatrix parameters.DotCodeParameters
getDotCode()
DotCode parameters.boolean
getEnableEscape()
Indicates whether explains the character "\" as an escape character in CodeText property.boolean
getFilledBars()
Gets a value indicating whether bars filled.int
getForeColor()
Deprecated."This method is obsolete.GS1CompositeBarParameters
getGS1CompositeBar()
GS1 Composite Bar parameters.ITFParameters
getITF()
ITF parameters.MaxiCodeParameters
getMaxiCode()
MaxiCode parameters.Padding
getPadding()
Barcode paddings.PatchCodeParameters
getPatchCode()
PatchCode parameters.Pdf417Parameters
getPdf417()
PDF417 parameters.PostalParameters
getPostal()
Postal parameters.int
getPostalShortBarHeight()
Deprecated.QrParameters
getQR()
QR parameters.int
getQuietZonesWidthInXDim()
Deprecated.float
getResolution()
Deprecated.int
getRows()
Deprecated.int
getStateHash()
Deprecated.SupplementParameters
getSupplement()
Supplement parameters.int
getSupplementSpace()
Deprecated.boolean
getThrowExceptionWhenCodeTextIncorrect()
Only for 1D barcodes.float
getWideNarrowRatio()
Wide bars to Narrow bars ratio.Unit
getXDimension()
x-dimension is the smallest width of the unit of BarCode bars or spaces.EnableChecksum
isChecksumEnabled()
void
setAutoSizeMode(AutoSizeMode value)
Deprecated."This method is obsolete.void
setBarCodeHeight(Unit value)
Deprecated."This method is obsolete.void
setBarcodeType(BaseEncodeType value)
void
setBarCodeWidth(Unit value)
Deprecated."This method is obsolete.void
setBarColor(int value)
Bars color.void
setBarHeight(Unit value)
Height of 1D barcodes' bars inUnit
value.void
setBarWidthReduction(Unit value)
Sets bars reduction value that is used to compensate ink spread while printing.void
setCalculatedBarCodeWidth(int value)
Deprecated.void
setChecksumAlwaysShow(boolean value)
Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.void
setChecksumEnabled(EnableChecksum value)
void
setCodeText(java.lang.String value)
void
setEnableEscape(boolean value)
Indicates whether explains the character "\" as an escape character in CodeText property.void
setFilledBars(boolean value)
Sets a value indicating whether bars filled.void
setForeColor(int value)
Deprecated."This method is obsolete.void
setGS1CompositeBar(GS1CompositeBarParameters value)
GS1 Composite Bar parameters.void
setThrowExceptionWhenCodeTextIncorrect(boolean value)
Only for 1D barcodes.void
setWideNarrowRatio(float value)
Wide bars to Narrow bars ratio.void
setXDimension(Unit value)
x-dimension is the smallest width of the unit of BarCode bars or spaces.
-
-
-
Method Detail
-
getBarcodeType
@Deprecated public BaseEncodeType getBarcodeType()
Deprecated.
-
setBarcodeType
public void setBarcodeType(BaseEncodeType value)
-
getCodeText
public java.lang.String getCodeText()
-
setCodeText
public void setCodeText(java.lang.String value)
-
getXDimension
public Unit getXDimension()
x-dimension is the smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if
AutoSizeMode
property is set to AutoSizeMode.Nearest or AutoSizeMode.INTERPOLATION.
-
setXDimension
public void setXDimension(Unit value)
x-dimension is the smallest width of the unit of BarCode bars or spaces. Increase this will increase the whole barcode image width. Ignored if
AutoSizeMode
property is set to AutoSizeMode.Nearest or AutoSizeMode.INTERPOLATION.
-
getBarHeight
public Unit getBarHeight()
Height of 1D barcodes' bars in
Unit
value. Ignored ifAutoSizeMode
property is set to AutoSizeMode.Nearest or AutoSizeMode.INTERPOLATION.
-
setBarHeight
public void setBarHeight(Unit value)
Height of 1D barcodes' bars in
Unit
value. Ignored ifAutoSizeMode
property is set to AutoSizeMode.Nearest or AutoSizeMode.INTERPOLATION.
-
getAutoSizeMode
@Deprecated public AutoSizeMode getAutoSizeMode()
Deprecated."This method is obsolete. Call BaseGenerationParameters.getAutoSizeMode() instead."Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.NONE.
-
setAutoSizeMode
@Deprecated public void setAutoSizeMode(AutoSizeMode value)
Deprecated."This method is obsolete. Call BaseGenerationParameters.setAutoSizeMode() instead."Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.NONE.
-
getBarCodeHeight
@Deprecated public Unit getBarCodeHeight()
Deprecated."This method is obsolete. Call BaseGenerationParameters.getImageHeight() instead."BarCode image height when
AutoSizeMode
property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.
-
setBarCodeHeight
@Deprecated public void setBarCodeHeight(Unit value)
Deprecated."This method is obsolete. Call BaseGenerationParameters.setImageHeight() instead."BarCode image height when
AutoSizeMode
property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.
-
getBarCodeWidth
@Deprecated public Unit getBarCodeWidth()
Deprecated."This method is obsolete. Call BaseGenerationParameters.getImageWidth() instead."BarCode image width when
AutoSizeMode
property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.
-
setBarCodeWidth
@Deprecated public void setBarCodeWidth(Unit value)
Deprecated."This method is obsolete. Call BaseGenerationParameters.setImageWidth() instead."BarCode image width when
AutoSizeMode
property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.
-
getForeColor
@Deprecated public int getForeColor()
Deprecated."This method is obsolete. Call BarcodeParameters.getBarColor() instead."Bars color. Default value: Color.BLACK.
-
setForeColor
@Deprecated public void setForeColor(int value)
Deprecated."This method is obsolete. Call BarcodeParameters.setBarColor() instead."Bars color. Default value: Color.BLACK.
-
getBarColor
public int getBarColor()
Bars color. Default value: Color.BLACK.
-
setBarColor
public void setBarColor(int value)
Bars color. Default value: Color.BLACK.
-
getPadding
public Padding getPadding()
Barcode paddings. Default value: 5pt 5pt 5pt 5pt.
-
getChecksumAlwaysShow
public boolean getChecksumAlwaysShow()
Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.
-
setChecksumAlwaysShow
public void setChecksumAlwaysShow(boolean value)
Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.
-
isChecksumEnabled
public EnableChecksum isChecksumEnabled()
Enable checksum during generation 1D barcodes.
Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible.
Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar
Checksum always used: Rest symbology
-
setChecksumEnabled
public void setChecksumEnabled(EnableChecksum value)
Enable checksum during generation 1D barcodes.
Default is treated as Yes for symbology which must contain checksum, as No where checksum only possible.
Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN, Codabar
Checksum always used: Rest symbology
-
getEnableEscape
public boolean getEnableEscape()
Indicates whether explains the character "\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, "\" will be explained as a special escape character. Otherwise, "\" acts as normal characters.
Aspose.BarCode supports inputing decimal ascii code and mnemonic for ASCII control-code characters. For example, \013 and \\CR stands for CR.
-
setEnableEscape
public void setEnableEscape(boolean value)
Indicates whether explains the character "\" as an escape character in CodeText property. Used for Pdf417, DataMatrix, Code128 only If the EnableEscape is true, "\" will be explained as a special escape character. Otherwise, "\" acts as normal characters.
Aspose.BarCode supports inputing decimal ascii code and mnemonic for ASCII control-code characters. For example, \013 and \\CR stands for CR.
-
getThrowExceptionWhenCodeTextIncorrect
public boolean getThrowExceptionWhenCodeTextIncorrect()
Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingapurePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect.
-
setThrowExceptionWhenCodeTextIncorrect
public void setThrowExceptionWhenCodeTextIncorrect(boolean value)
Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingapurePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect.
-
getWideNarrowRatio
public float getWideNarrowRatio()
Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard
- Throws:
java.lang.IllegalArgumentException
-<p>The <b>WideNarrowRatio</b> parameter value is less than or equal to 0.</p>
-
setWideNarrowRatio
public void setWideNarrowRatio(float value)
Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard
- Throws:
java.lang.IllegalArgumentException
-<p>The <b>WideNarrowRatio</b> parameter value is less than or equal to 0.</p>
-
getCodeTextParameters
public CodetextParameters getCodeTextParameters()
Codetext parameters.
-
getFilledBars
public boolean getFilledBars()
Gets a value indicating whether bars filled. Only for 1D barcodes. Default value: true.
-
setFilledBars
public void setFilledBars(boolean value)
Sets a value indicating whether bars filled. Only for 1D barcodes. Default value: true.
-
getBarWidthReduction
public Unit getBarWidthReduction()
Get bars reduction value that is used to compensate ink spread while printing.- Returns:
-
setBarWidthReduction
public void setBarWidthReduction(Unit value)
Sets bars reduction value that is used to compensate ink spread while printing.
-
getPostal
public PostalParameters getPostal()
Postal parameters. Used for Postnet, Planet.
-
getPatchCode
public PatchCodeParameters getPatchCode()
PatchCode parameters.
-
getAustralianPost
public AustralianPostParameters getAustralianPost()
AustralianPost barcode parameters.
-
getDataBar
public DataBarParameters getDataBar()
Databar parameters.
-
getGS1CompositeBar
public GS1CompositeBarParameters getGS1CompositeBar()
GS1 Composite Bar parameters. This sample shows how to create and save a GS1 Composite Bar image. Note that 1D codetext and 2D codetext are separated by symbol '/' String codetext = "(01)03212345678906/(21)A1B2C3D4E5F6G7H8"; BarcodeGenerator 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");- Returns:
- GS1 Composite Bar parameters.
-
setGS1CompositeBar
public void setGS1CompositeBar(GS1CompositeBarParameters value)
GS1 Composite Bar parameters. This sample shows how to create and save a GS1 Composite Bar image. Note that 1D codetext and 2D codetext are separated by symbol '/' String codetext = "(01)03212345678906/(21)A1B2C3D4E5F6G7H8"; BarcodeGenerator 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");
-
getCodablock
public CodablockParameters getCodablock()
Codablock parameters.
-
getDataMatrix
public DataMatrixParameters getDataMatrix()
DataMatrix parameters.
-
getCode16K
public Code16KParameters getCode16K()
Code16K parameters.
-
getDotCode
public DotCodeParameters getDotCode()
DotCode parameters.
-
getITF
public ITFParameters getITF()
ITF parameters.
-
getPdf417
public Pdf417Parameters getPdf417()
PDF417 parameters.
-
getQR
public QrParameters getQR()
QR parameters.
-
getSupplement
public SupplementParameters getSupplement()
Supplement parameters. Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN.
-
getMaxiCode
public MaxiCodeParameters getMaxiCode()
MaxiCode parameters.
-
getAztec
public AztecParameters getAztec()
Aztec parameters.
-
getCodabar
public CodabarParameters getCodabar()
Codabar parameters.
-
getCoupon
public CouponParameters getCoupon()
Coupon parameters. Used for UpcaGs1DatabarCoupon, UpcaGs1Code128Coupon.
-
getComplexBarcode
@Deprecated public com.aspose.barcode.generation.ComplexBarcode getComplexBarcode()
Deprecated.
-
getCalculatedBarCodeWidth
public int getCalculatedBarCodeWidth()
-
setCalculatedBarCodeWidth
@Deprecated public void setCalculatedBarCodeWidth(int value)
Deprecated.
-
getBackColor
@Deprecated public int getBackColor()
Deprecated.
-
getResolution
@Deprecated public float getResolution()
Deprecated.
-
getSupplementSpace
@Deprecated public int getSupplementSpace()
Deprecated.
-
getPostalShortBarHeight
@Deprecated public int getPostalShortBarHeight()
Deprecated.
-
getAspectRatio
@Deprecated public float getAspectRatio()
Deprecated.
-
getColumns
@Deprecated public int getColumns()
Deprecated.
-
getRows
@Deprecated public int getRows()
Deprecated.
-
getQuietZonesWidthInXDim
@Deprecated public int getQuietZonesWidthInXDim()
Deprecated.
-
getStateHash
@Deprecated public int getStateHash()
Deprecated.
-
-