GenerateBarcode - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


ImageTools

  

GenerateBarcode

  

generate barcode image encoding string or ByteArray

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

GenerateBarcode( data, opts )

Parameters

data

-

string or ByteArray; the data to be encoded

opts

-

(optional) one or more options as specified below

Options

• 

errorcorrection : posint or one of low, medium, quartile, or high

  

Specifies the error correction level in the generated barcode. The default is high.

• 

preferredheight : posint or auto

  

If a preferred height is specified, an integer scaling factor is applied to the generated image such that its height is as close to preferredheight as possible. By default, no scaling factor is applied.

• 

version : posint or posint..posint

  

Specifies a version number between 1 and 40 supported in the QR Code Model 2 standard to use in the generated barcode.

  

If a range is specified, a version within this range is automatically selected.

  

The default behavior is to automatically select a version between 1 and 40.

Description

• 

The GenerateBarcode(data,opts) command generates a barcode image of the string or ByteArray data as an Image.

Examples

Generate a simple barcode encoding text. The resulting image is scaled up for easier viewing.

withImageTools:

imgGenerateBarcodeHello, world!

EmbedScaleimg,4,method=nearest

Generate a URL-encoded barcode.

urlimgGenerateBarcodehttp://www.maplesoft.com

EmbedScaleurlimg,4,method=nearest

Embed mathematical data in a ByteArray and generate a barcode from it.

expr3sin2x+π2+4cos3x+π4+2

expr3cos2x+4cos3x+π4+2

(5.1)

encoded_exprconvertexpr,ByteArray,format=dotm

encoded_expr

(5.2)

exprimgGenerateBarcodeencoded_expr

EmbedGenerateBarcodeencoded_expr,preferredheight=100

Compatibility

• 

The ImageTools[GenerateBarcode] command was introduced in Maple 2022.

• 

For more information on Maple 2022 changes, see Updates in Maple 2022.

See Also

ImageTools

StringTools[ToByteArray]