Questo tutorial descrive come generare un codice a barre Data Matrix usando Python. It is structured in steps to set up the environment and a set of programming instructions, and includes sample code for a Data Matrix generator using Python. Vengono discusse varie opzioni API per controllare la conversione e creare un image personalizzato.
Steps to create a Data Matrix code with Python
- Set up the environment to use Aspose.BarCode for Python via .NET to generate a barcode
- Import the necessary classes from the library to generate the Data Matrix code.
- Instantiate the BarcodeGenerator with type DATA_MATRIX and input text.
- Set the encoding mode to AUTO to select the most efficient internal schema.
- Select the error correction level on ECC200 to read the damaged image thereafter.
- Set the size module cell and the resolution for the output image.
- Save the resulting matrix code as an image by setting the image format to PNG.
Questi passaggi descrivono il processo per creare un creatore di datamatrix usando Python. Inizia il processo creando l’oggetto BarcodeGenerator che accetta l’opzione EncodeTypes.DATA_MATRIX e il testo di input come argomenti. Furthermore, you can set the parameters to modify the image characteristics and the barcode behavior during reading.
Codice per creare un codice a barre Data Matrix con Python
This code demonstrates how to develop a datamatrix code generator using Python. It is possible to add a border, set a custom background, and rotate the barcode image. Sono disponibili anche opzioni per attivare l’anti‑aliasing per bordi più lisci, visualizzare una didascalia sull’immagine e impostare il rapporto d’aspetto se necessario.
Questo articolo aiuta a sviluppare un generatore di codici QR Data Matrix. To generate a QR code with a logo, refer to the article Create QR Code with Logo using Python.