Symbology Settings in Xamarin.Android SfBarcode

10 May 20224 minutes to read

Each and every Barcode symbology can be personalized with optional settings that may affect the appearance of specific Barcode.

One Dimensional Barcode settings

One dimensional Barcodes can be customized by using the following properties and they are commonly used for all the categories of supported one dimensional Barcodes.

  • By setting the BarHeight property, the height of the linear bars can be changed.
  • By setting the NarrowBarWidth property, the width ratio of the wide and narrow bars can be customized.

One dimensional Barcodes can also have error detection settings.

  • By enabling the EncodeStartStopSymbols property, start and stop symbols are added to signal a Barcode reader that a Barcode has been scanned.
  • The EnableCheckDigit property enables or disables the redundancy check by using a check digit that is the decimal equivalent of a binary parity bit.
  • With the help of ShowCheckDigit property, the check digit can be shown or hidden.

The following code example shows how to change the settings of the Code 39 linear Barcode.

  • XAML
  • //Changes the settings of Code 39 linear Barcode.
        <sync:Code39Setting BarHeight="45" EnableCheckDigit="False" EncodeStartStopSymbols="True" NarrowBarWidth="1" ShowCheckDigit="False"/>

    Similarly, you can specify the settings of other linear Barcodes corresponding to specified symbology.

    Two Dimensional Barcode Settings

    Two dimensional Barcodes are customized by using the XDimension property that modifies its block size and it is commonly used for all kinds of supported two dimensional Barcodes.

    Data Matrix Settings

    The Data Matrix symbology can be customized with the help of the following settings.

  • XAML
  • //Changes the settings of Data Matrix Barcode. 
        <sync:DataMatrixSetting XDimension="8" Encoding="ASCIINumeric” Size="Size104x104" /> 
    • The Encoding property is used to specify the encoding technique from enumeration of DataMatrixEncoding that contains encoding techniques such as ASCII, ASCIINumeric, Auto and Base256.
    • The Size property allows you to specify the size of the Barcode from a set of predefined sizes available in the DataMatrixSize enumeration.
    Matrix Size Description
    Auto Size is chosen based on the input data
    Size10x10 Square matrix with 10 rows and 10 columns.
    Size12x12 Square matrix with 12 rows and 12 columns.
    Size14x14 Square matrix with 14 rows and 14 columns.
    Size16x16 Square matrix with 16 rows and 16 columns.
    Size18x18 Square matrix with 18 rows and 18 columns.
    Size20x20 Square matrix with 20 rows and 20 columns.
    Size22x22 Square matrix with 22 rows and 22 columns.
    Size24x24 Square matrix with 24 rows and 24 columns.
    Size26x26 Square matrix with 26 rows and 26 columns.
    Size32x32 Square matrix with 32 rows and 32 columns.
    Size36x36 Square matrix with 36 rows and 36 columns.
    Size40x40 Square matrix with 40 rows and 40 columns.
    Size44x44 Square matrix with 44 rows and 44 columns.
    Size48x48 Square matrix with 48 rows and 48 columns.
    Size52x52 Square matrix with 52 rows and 52 columns.
    Size64x64 Square matrix with 64 rows and 64 columns.
    Size72x72 Square matrix with 72 rows and 72 columns.
    Size80x80 Square matrix with 80 rows and 80 columns.
    Size88x88 Square matrix with 88 rows and 88 columns.
    Size96x96 Square matrix with 96 rows and 96 columns.
    Size104x104 Square matrix with 104 rows and 104 columns.
    Size120x120 Square matrix with 120 rows and 120 columns.
    Size132x132 Square matrix with 132 rows and 132 columns.
    Size144x144 Square matrix with 144 rows and 144 columns.
    Size8x18 Rectangular matrix with 8 rows and 18 columns.
    Size8x32 Rectangular matrix with 8 rows and 32 columns.
    Size12x26 Rectangular matrix with 12 rows and 26 columns.
    Size12x36 Rectangular matrix with 12 rows and 36 columns.
    Size16x36 Rectangular matrix with 16 rows and 36 columns.
    Size16x48 Rectangular matrix with 16 rows and 48 columns.

    QR Code Settings

    The QR code symbology can be customized by using the following settings.

  • XAML
  • //Changes the settings of QR Barcode. 
        <sync:QRBarcodeSetting XDimension="8" ErrorCorrectionLevel="High” InputMode="BinaryMode” Version="Auto" /> 
    • The Version property allows you to set various types of version for QR code from QRVersion enumeration. By default, its value is set as Auto.
    QRVersion Description
    Version01 Measures 21 x 21 modules
    Version02 Measures 25 x 25 modules
    Version03 Measures 29 x 29 modules
    Version04 Measures 33 x 33 modules
    Version05 Measures 37 x 37 modules
    Version06 Measures 41 x 41 modules
    Version07 Measures 45 x 45 modules
    Version08 Measures 49 x 49 modules
    Version09 Measures 53 x 53 modules
    Version10 Measures 57 x 57 modules
    Version11 Measures 61 x 61 modules
    Version12 Measures 65 x 65 modules
    Version13 Measures 69 x 69 modules
    Version14 Measures 73 x 73 modules
    Version15 Measures 77 x 77 modules
    Version16 Measures 81 x 81 modules
    Version17 Measures 85 x 85 modules
    Version18 Measures 89 x 89 modules
    Version19 Measures 93 x 93 modules
    Version20 Measures 97 x 97 modules
    Version21 Measures 101 x 101 modules
    Version22 Measures 105 x 105 modules
    Version23 Measures 109 x 109 modules
    Version24 Measures 113 x 113 modules
    Version25 Measures 117 x 117 modules
    Version26 Measures 121 x 121 modules
    Version27 Measures 125 x 125 modules
    Version28 Measures 129 x 129 modules
    Version29 Measures 133 x 133 modules
    Version30 Measures 137 x 137 modules
    Version31 Measures 141 x 141 modules
    Version32 Measures 145 x 145 modules
    Version33 Measures 149 x 149 modules
    Version34 Measures 153 x 153 modules
    Version35 Measures 157 x 157 modules
    Version36 Measures 161 x 161 modules
    Version37 Measures 165 x 165 modules
    Version38 Measures 169 x 169 modules
    Version39 Measures 173 x 173 modules
    Version40 Measures 177 x 177 modules
    • The ErrorCorrectionLevel property employs error correction to generate a series of error correction code words that are added to the data code word sequence in order to enable the symbol to withstand damage without loss of data. By default, its value is set as Low.
    Error Correction Level Recovery Capacity % (approx.)
    Low 7
    Medium 15
    Quartile 25
    High 30
    • The InputMode property allows you to select specific set of input characters. You may select the most suitable input mode. By default, its value is set as BinaryMode.
    Input Mode Possible characters
    NumericMode 0,1,2,3,4,5,6,7,8,9
    AlphanumericMode 0 to 9, A to Z, space, $, %, *, +, -,., /, :
    BinaryMode Shift JIS characters