Use the barcode generator extension to generate a full range of barcodes (Codabar, Code 39, Code 128, EAN-8, EAN-13, ITF, PDF417, QR code, UPC-A). You can set the bar color and the background color and save the resulting image to your SD card. Note that the user must grant storage permission to your app.
Call the GenerateBarcode block with the following inputs:
text = the content of the barcode
format = choose one of the format specifications (CODABAR, CODE_39, CODE_128, EAN_8, EAN_13, ITF, PDF_417, QR_CODE, UPC_A) and provide it as a string
width and height = size in pixels (note that the generator may add a quiet zone around the barcode)
The Color and BackgroundColor blocks use the App Inventor color component.
The FileName is the relative path on your SD card, for example "barcode.png" or "/qr/barcode.png".
The example shows how the Barcode Generator can be used together with the ESC/POS Simple Converter. The user input consists of a text field for the content, a spinner using the format specifications as list of elements, and two numerical text fields for the size. A button generates the barcode and saves it to the SD card. It is then displayed on the screen and printed using a bluetooth thermal printer.
If you have questions or want to purchase the Barcode Generator extension, please contact me via the contact form!