Frequently Asked Questions
Licensing & Open Source
What license does Aspose.BarCode FOSS for Python use?
Aspose.BarCode FOSS for Python is released under the MIT License. The full license text is included in the LICENSE file distributed with the package. You are free to use, modify, and redistribute the library in both open-source and proprietary projects.
Can I use Aspose.BarCode FOSS in commercial products?
Yes. The MIT License permits commercial use without royalties or attribution requirements beyond including the original license notice. You do not need to open-source your application.
Installation & Requirements
How do I install Aspose.BarCode FOSS for Python?
Install from PyPI:
pip install aspose-barcode-fossThe library requires Python 3.12 or later.
Are there any native dependencies or system packages required?
No. Aspose.BarCode FOSS for Python is a pure-Python package. It has no native extensions, no C dependencies, and no system-level packages to install. It runs on Windows, macOS, and Linux — including slim Docker images like python:3.12-slim.
Symbology Support
Which barcode symbologies are supported?
The library supports seven symbologies:
| Symbology | Type | Options Class |
|---|---|---|
| Code 128 | 1D | Code128Options |
| Code 39 | 1D | Code39Options |
| EAN-13 | 1D | Ean13Options |
| EAN-8 | 1D | Ean8Options |
| QR Code | 2D | QrOptions |
| UPC-A | 1D | UpcaOptions |
| UPC-E | 1D | UpceOptions |
Each symbology has a dedicated helper function (code128(), code39(), ean13(), ean8(), qr(), upca(), upce()) and a generic generate() function that accepts a symbology name string.
What output formats are available?
The library renders barcodes to SVG and PNG:
to_svg()— returns an SVG stringto_png()— returns PNG bytes
Both methods accept an optional RenderOptions parameter for controlling scale, DPI, colors, quiet zone, and human-readable text.
API Usage
How do I generate a barcode?
Use a per-symbology helper function:
import aspose_barcode_foss as barcode
bc = barcode.code128("Hello World")
svg = bc.to_svg()
with open("barcode.svg", "w") as f:
f.write(svg)Or use the generic generate() function:
bc = barcode.generate("qr", "https://example.com")How do I configure encode options?
Each symbology has a dedicated options class. Pass it as the encode parameter:
from aspose_barcode_foss import QrOptions, QrErrorCorrectionLevel
bc = barcode.qr(
"https://example.com",
encode=QrOptions(error_correction_level=QrErrorCorrectionLevel.H),
)How do I control the visual appearance of the barcode?
Use RenderOptions with to_svg() or to_png():
from aspose_barcode_foss import RenderOptions
bc = barcode.code128("DATA")
png = bc.to_png(options=RenderOptions(
scale=3.0,
dpi=300,
foreground_color="#003366",
show_text=True,
))Available properties: scale, dpi, module_width, module_height, quiet_zone, foreground_color, background_color, transparent_background, show_text, font_family, font_size.
How does the library handle check digits for EAN and UPC barcodes?
By default, the library computes the check digit automatically. Supply only the payload digits (12 for EAN-13, 7 for EAN-8, 11 for UPC-A):
bc = barcode.ean13("590123412345") # 12 digits — check digit computedTo supply a pre-computed check digit, set allow_check_digit_input=True:
from aspose_barcode_foss import Ean13Options
bc = barcode.ean13(
"5901234123457", # 13 digits with check digit
encode=Ean13Options(allow_check_digit_input=True),
)Known Limitations
Is PDF output supported?
No. The to_pdf() method and PdfRenderer class exist in the API surface but raise NotImplementedError. Use to_svg() or to_png() instead. SVG output can be embedded in PDF documents using external tools.
Are ECI and GS1 standards supported?
Not yet. The EciHelper and Gs1Helper classes have method stubs that raise NotImplementedError. The eci_assignment_number and gs1_enabled properties on EncodeOptions are present but non-functional in the current release.
Can the library read or scan barcodes?
No. Aspose.BarCode FOSS for Python is a generation-only library. It creates barcodes from data but does not include barcode recognition or scanning capabilities.