generate DotCode barcode in Python

DotCode is a two-dimensional barcode that consists of a grid of dots arranged in a specific pattern. This barcode is widely used in the healthcare industry to label medication packages, surgical instruments, and other medical equipment. DotCode is also used in logistics and transportation to track packages and shipping containers. In this blog post, we will learn the simple and easy-to-use interface for generating DotCode barcode images. It will also show you how to generate DotCode barcode with Structured Append.

Python DotCode Barcode Generator API - Free API Download

To generate a DotCode barcode using Python, we will start by installing Aspose.BarCode for Python via .NET using pip. Once we have installed the library, we can import it into our Python script and start generating DotCode barcode images.

pip install aspose-barcode-for-python-via-net 

Generat DotCode Barcode in Python

The following steps show how to generate a DotCode barcode in Python:

  • Create an instance of BarcodeGenerator class and set DotCode encoding.
  • Set the number of rows and columns.
  • Export the output DotCode as a PNG or any other image format.

The code snippet below demonstrates how to generate a DotCode barcode in Python:

import aspose.barcode as barcode

# Initialize BarcodeGenerator class object
generator = barcode.generation.BarcodeGenerator(barcode.generation.EncodeTypes.DOT_CODE, "Aspose")

# Generate a DotCode barcode with 20 rows and 19 columns
generator.parameters.barcode.dot_code.columns = 19
generator.parameters.barcode.dot_code.rows = 20

# Generate DotCode barcode
generator.save("dotcode-barcode.png")

Generate DotCode with Structured Append using Python

DotCode with Structured Append allows large amounts of data to be encoded in a compact, efficient manner that can be easily scanned and decoded by a barcode reader. The data is divided into smaller segments and encoded in multiple DotCode barcodes, which are then combined into a single barcode using Structured Append. You can create it with the steps below:

  • Initialize a BarcodeGenerator class instance.
  • Generate a DotCode barcode in the structured append mode.
  • Save the output DotCode barcode in structured append mode.

The following code sample explains how to create a DotCode with structured append in Python.

import aspose.barcode as barcode

# Initialize BarcodeGenerator class object
generator = barcode.generation.BarcodeGenerator(barcode.generation.EncodeTypes.DOT_CODE, "Aspose")

# Generate a DotCode barcode in the structured append mode
generator.parameters.barcode.dot_code.dot_code_structured_append_mode_barcode_id = 3
generator.parameters.barcode.dot_code.dot_code_structured_append_mode_barcodes_count = 5

# Save the output DotCode barcode in structured append mode
generator.save("dotcode-barcode-structured.png")

Generate DotCode Barcode Online

You may create an DotCode barcode online without any registration or credit card information by visiting the link below:

https://products.aspose.app/barcode/generate/dotcode

Python DotCode Barcode Generator - Get a Free License

You may test all the features of the API to their full capacity by requesting a free temporary license. It helps you evaluate the API without any evaluation limitations.

How to Create Python DotCode Barcode - Read More

The following resources are useful to explore different features offered by the API.

Conclusion

In conclusion, this article explains how to work with a DotCode barcode generator in Python. It also covers creating the DotCode with Structured Append. However, please feel free to reach out to us at free support forum in case of any ambiguities.

See Also