The code given in
Seems to be outdated.
-
The package is not installed with pip install aspose-barcode but pip install asposebarcode
-
The code is throwing errors:
Traceback (most recent call last):
File "/Users/amir.giveon/GoogleDrive/pycharmProjects/rect_detect/test.py", line 11, in <module>
barcodeGeneratorExamples.generateBarcodeImage()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'BarcodeGeneratorExamples' object has no attribute 'generateBarcodeImage'. Did you mean: 'generateBarcodeImageExample'?
so then, I change to generateBarcodeImageExample and get:
Traceback (most recent call last):
File "/Users/amir.giveon/GoogleDrive/pycharmProjects/rect_detect/test.py", line 11, in <module>
barcodeGeneratorExamples.generateBarcodeImageExample()
File "/Users/amir.giveon/GoogleDrive/pycharmProjects/rect_detect/test.py", line 5, in generateBarcodeImageExample
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.OneCode, "12345")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py", line 784, in __getattr__
raise AttributeError(name) from None
AttributeError: OneCode
I keep changing things “blindly” and get:
Traceback (most recent call last):
File "/Users/amir.giveon/GoogleDrive/pycharmProjects/rect_detect/test.py", line 11, in <module>
barcodeGeneratorExamples.generateBarcodeImageExample()
File "/Users/amir.giveon/GoogleDrive/pycharmProjects/rect_detect/test.py", line 6, in generateBarcodeImageExample
generator.getParameters().getBarcode().getCodeTextParameters().setLocation(CodeLocation.Below)
^^^^^^^^^^^^
NameError: name 'CodeLocation' is not defined
Does anyone have a basic working code?