New to Kendo UI for AngularStart a free 30-day trial

Represents the Kendo UI Barcode component for Angular.

Use this component to display a barcode in your Angular application.

Definition

Package:@progress/kendo-angular-barcodes

Selector:kendo-barcode

Export Name:Accessible in templates as #kendoBarcodeInstance="kendoBarcode"

Syntax:

TS
import { Component } from '@angular/core';

@Component({
   selector: 'my-app',
   template: `
       <kendo-barcode type="EAN8" value="1234567">
       </kendo-barcode>
   `
})
export class AppComponent {
}

Inputs

Sets the background color of the Barcode. Accepts any valid CSS color string, such as hex or rgb.

Default:

"white"

Configures the border of the Barcode.

checksum?

boolean

Shows the checksum digit next to the value in the text area when set to true.

Default:

false

color?

string

Sets the color of the Barcode. Accepts any valid CSS color string, such as hex or rgb.

Default:

"black"

height?

number

Sets the height of the Barcode in pixels.

You can also set the Barcode dimensions using CSS.

Sets the padding of the Barcode. Use a number to set all paddings, or a Padding object for the individual sides.

Default:

0

Sets the rendering mode of the Barcode.

Use "canvas" to render as a Canvas element or "svg" to render as an inline SVG.

Default:

"svg"

Limits how often the Barcode resizes automatically. Sets the maximum number of redraws per second when the container size changes. Set to 0 to disable automatic resizing.

Default:

10

Configures the Barcode text label.

Sets the symbology (encoding) for the Barcode.

Default:

"Code39"

value

string | number

Sets the value of the Barcode.

width?

number

Sets the width of the Barcode in pixels.

You can also set the Barcode dimensions using CSS.

Methods

Exports the component as an image. The export operation is asynchronous and returns a promise.

Parameters:optionsImageExportOptions

The parameters for the exported image.

Returns:

Promise​<string>

  • A promise that will be resolved with a PNG image encoded as a Data URI.

Exports the component as an SVG document. The export operation is asynchronous and returns a promise.

Parameters:optionsSVGExportOptions

The parameters for the exported file.

Returns:

Promise​<string>

  • A promise that will be resolved with an SVG document that is encoded as a Data URI.

Exports the component as a Drawing Group.

Returns:

Group

  • The exported Group.

Detects the size of the container and redraws the component. Resizing is automatic unless you set the resizeRateLimit option to 0.