Aspose.Barcode for Python via Java Generation and Recognition API docs
BarcodeParameters Class Reference

Barcode generation parameters. More...

Inherits BaseJavaClass.

Public Member Functions

def __init__ (self, javaClass)
 
AustralianPostParameters getAustralianPost (self)
 AustralianPost barcode parameters. More...
 
AztecParameters getAztec (self)
 Aztec parameters. More...
 
Tuple[int, int, int] getBarColor (self)
 Bars color, representation of an RGB tuple. More...
 
Unit getBarHeight (self)
 Height of 1D barcodes' bars in Unit value. More...
 
Unit getBarWidthReduction (self)
 Get bars reduction value that is used to compensate ink spread while printing. More...
 
bool getChecksumAlwaysShow (self)
 Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. More...
 
CodabarParameters getCodabar (self)
 Codabar parameters. More...
 
CodablockParameters getCodablock (self)
 Codablock parameters. More...
 
Code128Parameters getCode128 (self)
 Code128 parameters. More...
 
Code16KParameters getCode16K (self)
 Code16K parameters. More...
 
CodetextParameters getCodeTextParameters (self)
 Codetext parameters. More...
 
CouponParameters getCoupon (self)
 Coupon parameters. More...
 
DataBarParameters getDataBar (self)
 Databar parameters. More...
 
DataMatrixParameters getDataMatrix (self)
 DataMatrix parameters. More...
 
DotCodeParameters getDotCode (self)
 DotCode parameters. More...
 
bool getEnableEscape (self)
 Indicates whether explains the character "\" as an escape character in CodeText property. More...
 
bool getFilledBars (self)
 Gets a value indicating whether bars filled. More...
 
GS1CompositeBarParameters getGS1CompositeBar (self)
 GS1 Composite Bar parameters. More...
 
HanXinParameters getHanXin (self)
 HanXin parameters. More...
 
ITFParameters getITF (self)
 ITF parameters. More...
 
MaxiCodeParameters getMaxiCode (self)
 MaxiCode parameters. More...
 
Padding getPadding (self)
 Barcode paddings. More...
 
PatchCodeParameters getPatchCode (self)
 PatchCode parameters. More...
 
Pdf417Parameters getPdf417 (self)
 PDF417 parameters. More...
 
PostalParameters getPostal (self)
 Postal parameters. More...
 
QrParameters getQR (self)
 QR parameters. More...
 
SupplementParameters getSupplement (self)
 Supplement parameters. More...
 
float getWideNarrowRatio (self)
 Wide bars to Narrow bars ratio. More...
 
Unit getXDimension (self)
 x-dimension is the smallest width of the unit of BarCode bars or spaces. More...
 
None init (self)
 
EnableChecksum isChecksumEnabled (self)
 Enable checksum during generation 1D barcodes. More...
 
None setBarColor (self, Tuple[int, int, int] value)
 Bars color, representation of an RGB tuple. More...
 
None setBarHeight (self, Unit value)
 Height of 1D barcodes' bars in Unit value. More...
 
None setBarWidthReduction (self, Unit value)
 Sets bars reduction value that is used to compensate ink spread while printing. More...
 
None setChecksumAlwaysShow (self, bool value)
 Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes. More...
 
None setChecksumEnabled (self, EnableChecksum value)
 Enable checksum during generation 1D barcodes. More...
 
None setEnableEscape (self, bool value)
 Indicates whether explains the character "\" as an escape character in CodeText property. More...
 
None setFilledBars (self, bool value)
 Sets a value indicating whether bars filled. More...
 
None setGS1CompositeBar (self, GS1CompositeBarParameters value)
 GS1 Composite Bar parameters. More...
 
None setWideNarrowRatio (self, float value)
 Wide bars to Narrow bars ratio. More...
 
None setXDimension (self, Unit unit)
 x-dimension is the smallest width of the unit of BarCode bars or spaces. More...
 
- Public Member Functions inherited from BaseJavaClass
def getJavaClass (self)
 
str getJavaClassName (self)
 
bool isNull (self)
 
None printJavaClassName (self)
 
None setJavaClass (self, javaClass)
 

Public Attributes

 barHeight
 
 barWidthReduction
 
 gs1CompositeBar
 
 xDimension
 
- Public Attributes inherited from BaseJavaClass
 javaClass
 
 javaClassName
 

Detailed Description

Barcode generation parameters.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  javaClass 
)

Reimplemented from BaseJavaClass.

Member Function Documentation

◆ getAustralianPost()

AustralianPostParameters getAustralianPost (   self)

AustralianPost barcode parameters.

◆ getAztec()

AztecParameters getAztec (   self)

Aztec parameters.

◆ getBarColor()

Tuple[int, int, int] getBarColor (   self)

Bars color, representation of an RGB tuple.

Default value: 0

◆ getBarHeight()

Unit getBarHeight (   self)

Height of 1D barcodes' bars in Unit value.

Ignored if AutoSizeMode property is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.

Exceptions
BarCodeException

◆ getBarWidthReduction()

Unit getBarWidthReduction (   self)

Get bars reduction value that is used to compensate ink spread while printing.

Returns
Unit value of BarWidthReduction

◆ getChecksumAlwaysShow()

bool getChecksumAlwaysShow (   self)

Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.

◆ getCodabar()

CodabarParameters getCodabar (   self)

Codabar parameters.

◆ getCodablock()

CodablockParameters getCodablock (   self)

Codablock parameters.

◆ getCode128()

Code128Parameters getCode128 (   self)

Code128 parameters.

◆ getCode16K()

Code16KParameters getCode16K (   self)

Code16K parameters.

◆ getCodeTextParameters()

CodetextParameters getCodeTextParameters (   self)

Codetext parameters.

◆ getCoupon()

CouponParameters getCoupon (   self)

Coupon parameters.

Used for UpcaGs1DatabarCoupon, UpcaGs1Code128Coupon.

◆ getDataBar()

DataBarParameters getDataBar (   self)

Databar parameters.

◆ getDataMatrix()

DataMatrixParameters getDataMatrix (   self)

DataMatrix parameters.

◆ getDotCode()

DotCodeParameters getDotCode (   self)

DotCode parameters.

◆ getEnableEscape()

bool getEnableEscape (   self)

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.

◆ getFilledBars()

bool getFilledBars (   self)

Gets a value indicating whether bars filled.

Only for 1D barcodes. Default value: True.

◆ getGS1CompositeBar()

GS1CompositeBarParameters getGS1CompositeBar (   self)

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 '/'

codetext = "(01)03212345678906|(21)A1B2C3D4E5F6G7H8"
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.GS_1_COMPOSITE_BAR, codetext)
generator.getParameters().getBarcode().getGS1CompositeBar().setLinearComponentType(Generation.EncodeTypes.GS_1_CODE_128)
generator.getParameters().getBarcode().getGS1CompositeBar().setTwoDComponentType(Generation.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(self.image_path_to_save4, Generation.BarCodeImageFormat.PNG)
Returns
GS1CompositeBarParameters GS1 Composite Bar parameters.

◆ getHanXin()

HanXinParameters getHanXin (   self)

HanXin parameters.

◆ getITF()

ITFParameters getITF (   self)

ITF parameters.

◆ getMaxiCode()

MaxiCodeParameters getMaxiCode (   self)

MaxiCode parameters.

◆ getPadding()

Padding getPadding (   self)

Barcode paddings.

Default value: 5pt 5pt 5pt 5pt.

◆ getPatchCode()

PatchCodeParameters getPatchCode (   self)

PatchCode parameters.

◆ getPdf417()

Pdf417Parameters getPdf417 (   self)

PDF417 parameters.

◆ getPostal()

PostalParameters getPostal (   self)

Postal parameters.

Used for Postnet, Planet.

◆ getQR()

QrParameters getQR (   self)

QR parameters.

◆ getSupplement()

SupplementParameters getSupplement (   self)

Supplement parameters.

Used for Interleaved2of5, Standard2of5, EAN13, EAN8, UPCA, UPCE, ISBN, ISSN, ISMN.

◆ getWideNarrowRatio()

float getWideNarrowRatio (   self)

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 The WideNarrowRatio parameter value is less than or equal to 0.

◆ getXDimension()

Unit getXDimension (   self)

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.

◆ init()

None init (   self)

Reimplemented from BaseJavaClass.

◆ isChecksumEnabled()

EnableChecksum isChecksumEnabled (   self)

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

◆ setBarColor()

None setBarColor (   self,
Tuple[int, int, int]  value 
)

Bars color, representation of an RGB tuple.

Default value: 0.

◆ setBarHeight()

None setBarHeight (   self,
Unit  value 
)

Height of 1D barcodes' bars in Unit value.

Ignored if AutoSizeMode property is set to AutoSizeMode.NEAREST or AutoSizeMode.INTERPOLATION.

Exceptions
BarCodeException

◆ setBarWidthReduction()

None setBarWidthReduction (   self,
Unit  value 
)

Sets bars reduction value that is used to compensate ink spread while printing.

◆ setChecksumAlwaysShow()

None setChecksumAlwaysShow (   self,
bool  value 
)

Always display checksum digit in the human readable text for Code128 and GS1Code128 barcodes.

◆ setChecksumEnabled()

None setChecksumEnabled (   self,
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

◆ setEnableEscape()

None setEnableEscape (   self,
bool  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.

◆ setFilledBars()

None setFilledBars (   self,
bool  value 
)

Sets a value indicating whether bars filled.

Only for 1D barcodes. Default value: True.

◆ setGS1CompositeBar()

None setGS1CompositeBar (   self,
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 '/'

\code
codetext = "(01)03212345678906|(21)A1B2C3D4E5F6G7H8"
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.GS_1_COMPOSITE_BAR, codetext)
generator.getParameters().getBarcode().getGS1CompositeBar().setLinearComponentType(Generation.EncodeTypes.GS_1_CODE_128)
generator.getParameters().getBarcode().getGS1CompositeBar().setTwoDComponentType(Generation.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(self.image_path_to_save4, Generation.BarCodeImageFormat.PNG)

◆ setWideNarrowRatio()

None setWideNarrowRatio (   self,
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 The WideNarrowRatio parameter value is less than or equal to 0.

◆ setXDimension()

None setXDimension (   self,
Unit  unit 
)

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.

Exceptions
BarCodeException

Member Data Documentation

◆ barHeight

barHeight

◆ barWidthReduction

barWidthReduction

◆ gs1CompositeBar

gs1CompositeBar

◆ xDimension

xDimension