![]() |
Aspose.Barcode for Python via Java Generation and Recognition API docs
|
BarcodeGenerator for backend barcode images generation. More...
Inherits BaseJavaClass.
Public Member Functions | |
| def | __init__ (self, encodeType, Optional[str] codeText) |
| BarcodeGenerator constructor. More... | |
| str | __str__ (self) |
| bool | exportToXml (self, str filePath) |
| Exports BarCode properties to the xml-stream specified. More... | |
| Image | generateBarCodeImage (self) |
| Generate the barcode image under current settings. More... | |
| EncodeTypes | getBarcodeType (self) |
| Barcode symbology type. More... | |
| str | getCodeText (self) |
| Text to be encoded. More... | |
| BaseGenerationParameters | getParameters (self) |
| Generation parameters. More... | |
| None | init (self) |
| None | save (self, str imagePath, BarCodeImageFormat imageFormat) |
| Save barcode image to specific file in specific format. More... | |
| None | setBarcodeType (self, EncodeTypes encodeType) |
| Barcode symbology type. More... | |
| None | setCodeText (self, Union[str, bytes] value, Optional[str] encoding) |
Public Member Functions inherited from BaseJavaClass | |
| None | __init__ (self, javaClass) |
| def | getJavaClass (self) |
| str | getJavaClassName (self) |
| bool | isNull (self) |
| None | printJavaClassName (self) |
| None | setJavaClass (self, javaClass) |
Static Public Member Functions | |
| BarcodeGenerator | construct (javaClass) |
| BarcodeGenerator | importFromXml (str resource) |
| Imports BarCode properties from the xml-file specified and creates BarcodeGenerator instance. More... | |
| str | loadFileBase64String (str filepath) |
| str | loadTextFileBase64String (str filepath) |
Public Attributes | |
| javaClass | |
| parameters | |
Public Attributes inherited from BaseJavaClass | |
| javaClass | |
| javaClassName | |
Static Public Attributes | |
| string | javaClassName = 'com.aspose.mw.barcode.generation.MwBarcodeGenerator' |
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.
| def __init__ | ( | self, | |
| encodeType, | |||
| Optional[str] | codeText | ||
| ) |
BarcodeGenerator constructor.
| args | may 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")
|
| BarCodeException |
| str __str__ | ( | self | ) |
Returns a string representation of the BarcodeGenerator object, showing key information.
|
static |
| bool exportToXml | ( | self, | |
| str | filePath | ||
| ) |
Exports BarCode properties to the xml-stream specified.
| filePath | The path to the file where the XML will be saved. |
| Image generateBarCodeImage | ( | self | ) |
Generate the barcode image under current settings.
This sample shows how to create and save a barcode image.
| EncodeTypes getBarcodeType | ( | self | ) |
Barcode symbology type.
| str getCodeText | ( | self | ) |
Text to be encoded.
| BaseGenerationParameters getParameters | ( | self | ) |
Generation parameters.
|
static |
Imports BarCode properties from the xml-file specified and creates BarcodeGenerator instance.
| resource: The name of the file |
| None init | ( | self | ) |
Reimplemented from BaseJavaClass.
|
static |
Converts a file to a base64-encoded string.
|
static |
| None save | ( | self, | |
| str | imagePath, | ||
| BarCodeImageFormat | imageFormat | ||
| ) |
Save barcode image to specific file in specific format.
| imagePath | Path to save to. |
| imageFormat | Optional 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. generator = Generation.BarcodeGenerator(Generation.EncodeTypes.CODE_128, "123ABCDEFG")
generator.save(self.image_path_to_save3, Generation.BarCodeImageFormat.PNG)
|
| None setBarcodeType | ( | self, | |
| EncodeTypes | encodeType | ||
| ) |
Barcode symbology type.
| None setCodeText | ( | self, | |
| Union[str, bytes] | value, | ||
| Optional[str] | encoding | ||
| ) |
Encodes codetext with a byte order mark (BOM) using the specified encoding.
@param value: The CodeText string or bytes.
If a bytes object is provided, it will be encoded to Base64.
@param encoding: The encoding to apply when processing the string value.
If 'value' is a bytes object, it is encoded using Base64.
If 'value' is a string, it's passed to 'setCodeText' of the Java class along with the specified encoding.
| javaClass |
|
static |
| parameters |