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

BarcodeGenerator for backend barcode images generation. More...

Inherits asposebarcode.Assist.BaseJavaClass.

Public Member Functions

def __init__ (self, encodeType, codeText)
 BarcodeGenerator constructor. More...
 
def init (self)
 
def getParameters (self)
 Generation parameters. More...
 
def getBarcodeType (self)
 Barcode symbology type. More...
 
def setBarcodeType (self, value)
 Barcode symbology type. More...
 
def generateBarCodeImage (self)
 Generate the barcode image under current settings. More...
 
def save (self, imagePath, imageFormat)
 Save barcode image to specific file in specific format. More...
 
def getCodeText (self)
 Text to be encoded. More...
 
def setCodeText (self, value)
 Text to be encoded. More...
 
def exportToXml (self, filePath)
 
- Public Member Functions inherited from asposebarcode.Assist.BaseJavaClass
def __init__ (self, javaClass)
 
def getJavaClass (self)
 
def setJavaClass (self, javaClass)
 
def getJavaClassName (self)
 
def isNull (self)
 
def printJavaClassName (self)
 

Static Public Member Functions

def construct (javaClass)
 
def importFromXml (resource)
 Imports BarCode properties from the xml-file specified and creates BarcodeGenerator instance. More...
 
def loadFileBase64String (filepath)
 

Public Attributes

 javaClass
 
 parameters
 
- Public Attributes inherited from asposebarcode.Assist.BaseJavaClass
 javaClass
 
 javaClassName
 

Static Public Attributes

string javaClassName = 'com.aspose.mw.barcode.generation.MwBarcodeGenerator'
 

Detailed Description

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 ...

This sample shows how to create and save a barcode image.

encode_type = EncodeTypes.CODE_128
generator = BarcodeGenerator($encode_type)
generator = BarcodeGenerator($encode_type)
generator = BarcodeGenerator($encode_type)
generator = BarcodeGenerator($encode_type)
generator = BarcodeGenerator($encode_type)
generator.setCodeText("123ABC")

Constructor & Destructor Documentation

◆ __init__()

def asposebarcode.Generation.BarcodeGenerator.__init__ (   self,
  encodeType,
  codeText 
)

BarcodeGenerator constructor.

Parameters
argsmay take the following combinations of arguments:
1) Barcode symbology type. Use EncodeTypes class to setup a symbology
2) type EncodeTypes, Text to be encoded.
barcodeGenerator = BarcodeGenerator(EncodeTypes.EAN_14, "332211")
Exceptions
BarCodeException

Member Function Documentation

◆ construct()

def asposebarcode.Generation.BarcodeGenerator.construct (   javaClass)
static

◆ exportToXml()

def asposebarcode.Generation.BarcodeGenerator.exportToXml (   self,
  filePath 
)
Exports BarCode properties to the xml-stream specified
:param resource:  The xml-stream
:return: Whether or not export completed successfully. Returns <b>True</b> in case of success; <b>False</b> Otherwise

◆ generateBarCodeImage()

def asposebarcode.Generation.BarcodeGenerator.generateBarCodeImage (   self)

Generate the barcode image under current settings.

This sample shows how to create and save a barcode image. generator = BarCodeGenerator(EncodeTypes.CODE_128) image = generator.generateBarCodeImage()

Returns
Pillow Image object of barcode image

◆ getBarcodeType()

def asposebarcode.Generation.BarcodeGenerator.getBarcodeType (   self)

Barcode symbology type.

◆ getCodeText()

def asposebarcode.Generation.BarcodeGenerator.getCodeText (   self)

Text to be encoded.

◆ getParameters()

def asposebarcode.Generation.BarcodeGenerator.getParameters (   self)

◆ importFromXml()

def asposebarcode.Generation.BarcodeGenerator.importFromXml (   resource)
static

Imports BarCode properties from the xml-file specified and creates BarcodeGenerator instance.

:param resource: The name of the file :return: instance

◆ init()

def asposebarcode.Generation.BarcodeGenerator.init (   self)

◆ loadFileBase64String()

def asposebarcode.Generation.BarcodeGenerator.loadFileBase64String (   filepath)
static

◆ save()

def asposebarcode.Generation.BarcodeGenerator.save (   self,
  imagePath,
  imageFormat 
)

Save barcode image to specific file in specific format.

Parameters
imagePathPath to save to.
imageFormatOptional format override. If omitted, the format to use is determined from the filename extension. If a file object was used instead of a filename, this parameter should always be used. file_path = "img1.png" generator = BarCodeGenerator(EncodeTypes.CODE_128) generator.save(file_path, "PNG")

◆ setBarcodeType()

def asposebarcode.Generation.BarcodeGenerator.setBarcodeType (   self,
  value 
)

Barcode symbology type.

◆ setCodeText()

def asposebarcode.Generation.BarcodeGenerator.setCodeText (   self,
  value 
)

Text to be encoded.


Member Data Documentation

◆ javaClass

asposebarcode.Generation.BarcodeGenerator.javaClass

◆ javaClassName

string asposebarcode.Generation.BarcodeGenerator.javaClassName = 'com.aspose.mw.barcode.generation.MwBarcodeGenerator'
static

◆ parameters

asposebarcode.Generation.BarcodeGenerator.parameters