BarcodeImage
BarcodeImage["string"]
generates a barcode image of "string" in the "QR" format.
BarcodeImage["string",format]
generates a barcode image of "string" in the specified format.
BarcodeImage["string",format,size]
attempts to generate a barcode image of the specified size.
Details
- BarcodeImage always returns a binary image.
- Possible values for size include:
-
width approximate width, height is computed automatically {width,height} approximate width and height - If the specified size does not provide sufficient resolution for generating the barcode, an image of a larger size is generated. »
- The following 1D barcode formats can be used for format:
-
"UPC" UPC-A 12 numerical digits "UPCE" UPC-E 8 numerical digits "EAN8" EAN-8 8 numerical digits "EAN13" EAN-13 13 numerical digits "Code39" Code 39 up to 80 characters of uppercase letters, numeric digits, special characters -, ., $, /, +, %, and space "Code93" Code 93 uppercase letters, numeric digits, special characters -, ., $, /, +, %, and space "Code128" Code 128 up to 80 ASCII characters "ITF" ITF up to 80 numerical digits of an even length "Codabar" Codabar numerical digits and special characters :, /, +, . - The following 2D barcode formats can be used for format:
-
"Aztec" Aztec (error correction 2) 3000 ASCII or 3748 numeric {"Aztec", lev} Aztec (error correction lev) ASCII characters (less storage for higher levels) "DataMatrix" Data Matrix code 2335 ASCII or 3116 numeric "QR" QR (error correction 2) 2953 ASCII, 7089 numeric or 4296 alphanumeric {"QR",lev} QR (error correction lev) ASCII characters (less storage for higher levels) "PDF417" PDF417 (error correction 2) up to 1781 ASCII characters {"PDF417",lev} PDF417 (error correction lev) ASCII characters (less storage for higher levels) - The error correction level lev can be an integer between 0 and 8.
Examples
open allclose allBasic Examples (4)
Scope (16)
Generate a UPC barcode from a 12-digit numerical code:
With an 11-digit code, the checksum is automatically computed:
Generate a UPC barcode from an 8-digit numerical code:
With a 7-digit code, the checksum is automatically computed:
With a 7-digit code, the checksum is automatically computed:
Generate an EAN-13 barcode from a 13-digit numerical code:
With a 12-digit code, the checksum is automatically computed:
Generate a Code 39 barcode from numerical digits:
Generate a Code 39 barcode from an alphanumeric string:
Generate a Code 93 barcode from numerical digits:
Generate a Code 39 barcode from an alphanumeric string:
Generate an Aztec code with the error correction level 7:
Applications (3)
Properties & Relations (4)
Use BarcodeRecognize to convert a barcode image to a string:
Compute the UPC-A checksum from an 11-digit code:
The checksum is automatically computed if not provided and used as the 12th digit:
Compute the EAN-8 checksum for a 7-digit code:
BarcodeImage automatically computes the checksum:
Compute the EAN-13 checksum for a 12-digit code:
BarcodeImage automatically computes the checksum:
Possible Issues (4)
In generating 1D barcode images, the width specification might be ignored:
The resulting width is the minimum required to represent the barcode image:
In generating 2D barcode images, the size specification might be ignored:
Different formats have requirements for the input string, including length and supported characters:
For formats with a checksum character, an incorrect checksum is replaced with the correct value:
Text
Wolfram Research (2014), BarcodeImage, Wolfram Language function, https://reference.wolfram.com/language/ref/BarcodeImage.html (updated 2023).
CMS
Wolfram Language. 2014. "BarcodeImage." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/BarcodeImage.html.
APA
Wolfram Language. (2014). BarcodeImage. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BarcodeImage.html