encode

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

Encode a barcode using the default settings.

Return

BitMatrix representing encoded barcode image

Parameters

contents

The contents to encode in the barcode

format

The barcode format to generate

width

The preferred width in pixels

height

The preferred height in pixels

Throws

if contents cannot be encoded legally in a format


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

Return

BitMatrix representing encoded barcode image

Parameters

contents

The contents to encode in the barcode

format

The barcode format to generate

width

The preferred width in pixels

height

The preferred height in pixels

hints

Additional parameters to supply to the encoder

Throws

if contents cannot be encoded legally in a format