BarcodeComponent
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:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<kendo-barcode type="EAN8" value="1234567">
</kendo-barcode>
`
})
export class AppComponent {
}
Inputs
background?
string
Sets the background color of the Barcode. Accepts any valid CSS color string, such as hex or rgb.
"white"
checksum?
boolean
Shows the checksum digit next to the value in the text area when set to true.
false
color?
string
Sets the color of the Barcode. Accepts any valid CSS color string, such as hex or rgb.
"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.
0
Sets the rendering mode of the Barcode.
Use "canvas" to render as a Canvas element or "svg" to render as an inline SVG.
"svg"
resizeRateLimit
number
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.
10
Configures the Barcode text label.
Sets the symbology (encoding) for the Barcode.
"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.
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.
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.
- The exported Group.
Detects the size of the container and redraws the component.
Resizing is automatic unless you set the resizeRateLimit option to 0.