UPCEANWriter

Encapsulates functionality and implementation that is common to UPC and EAN families of one-dimensional barcodes.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
abstract fun encode(contents: String): BooleanArray

Encode the contents to boolean array expression of one-dimensional barcode. Start code and end code should be included in result, and side margins should not be included.

open fun encode(contents: String, hints: Map<EncodeHintType, *>?): BooleanArray

Can be overwritten if the encode requires to read the hints map. Otherwise it defaults to encode.

override fun encode(contents: String, format: BarcodeFormat, width: Int, height: Int): BitMatrix

Encode a barcode using the default settings.

open override fun encode(contents: String, format: BarcodeFormat, width: Int, height: Int, hints: Map<EncodeHintType, *>?): BitMatrix

Encode the contents following specified format. width and height are required size. This method may return bigger size BitMatrix when specified size is too small. The user can set both width and height to zero to get minimum size barcode. If negative value is set to width or height, IllegalArgumentException is thrown.

Link copied to clipboard
open override fun getDefaultMargin(): Int