Loading...
Loading...
Use Syncfusion EJ2 Angular Barcode/QR components to generate and customize barcodes in Angular. Trigger for Code39/Code128, EAN/UPC, QR Code, Data Matrix, label printing, inventory/product tags, colors/sizing/text, logo overlays, rendering, and export (PNG/SVG/PDF).
npx skill4agent add syncfusion/angular-ui-components-skills syncfusion-angular-barcodereferences/*.md| Type | Use Case | Character Set | Industry |
|---|---|---|---|
| Linear (Code39, Code128, Code11, Codabar, Code32, Code93) | Product IDs, serial numbers, inventory | Alphanumeric (varies by type) | Retail, Warehouse, Telecom |
| QR Code | URLs, contact info, payments | Full Unicode | Marketing, Mobile, Finance |
| Data Matrix | Compact encoding, small labels | Numeric/Alphanumeric | Healthcare, Manufacturing, Logistics |
QRCodeLogo@syncfusion/ej2-angular-barcode-generatorQRCodeLogoimageSource<!-- app.component.html -->
<ejs-barcodegenerator
#barcode
type="Code128"
value="123456789"
width="200px"
height="150px">
</ejs-barcodegenerator>// app.component.ts
import { Component } from '@angular/core';
import { BarcodeGeneratorComponent } from '@syncfusion/ej2-angular-barcode-generator';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {}<ejs-barcodegenerator
type="QRCode"
value="https://example.com"
[foreColor]="'#FF0000'"
width="200px"
height="200px">
</ejs-barcodegenerator>// Light background
@barcode type="Code128" foreColor="#000000" backgroundColor="#FFFFFF"
// Dark background
@barcode type="Code128" foreColor="#FFFFFF" backgroundColor="#000000"
// Branded QR code
@barcode type="QRCode" [qRCodeLogo]="logoConfig" foreColor="#1976D2"export class BarcodeComponent {
@ViewChild('barcode') barcode: BarcodeGeneratorComponent;
downloadBarcode() {
this.barcode.exportImage('barcode','PNG');
}
getBase64() {
const base64String = this.barcode.toDataURL('image/png');
// Send to server or store
}
}<ejs-barcodegenerator
type="QRCode"
value="https://mysite.com"
#qrCode>
</ejs-barcodegenerator>export class BrandedQRComponent implements OnInit {
@ViewChild('qrCode') qrCode: BarcodeGeneratorComponent;
ngOnInit() {
(this.qrCode.qrcodelogo as QRCodeLogo) = {
imageSource: 'assets/logo.svg',
width: 50,
height: 50
};
}
}| Property | Type | Use When | Default |
|---|---|---|---|
| string | Selecting barcode type (Code128, QRCode, DataMatrix) | Code128 |
| string | Setting encoded data | "" |
| string | Controlling barcode width (px, %) | Auto |
| string | Controlling barcode height (px, %) | Auto |
| string | Setting barcode color (#RGB or name) | #000000 |
| string | Setting background color | #FFFFFF |
| object | | Adding human-readable label below barcode |
| object | Adding space around barcode | {left: 0, right: 0, top: 0, bottom: 0} |
| object | Adding logo to QR code (imageSource, width, height) | undefined |
| string | Rendering mode (SVG or Canvas) | SVG |
// Create multiple product barcodes with customization
products.forEach(product => {
<ejs-barcodegenerator
type="Code128"
[value]="product.sku"
[displayText]="{ text: 'Product SKU: 123456789', visibility: true }"
foreColor="#333333"
width="150px"
height="100px">
</ejs-barcodegenerator>
});// QR code for app promotion with branded logo
<ejs-barcodegenerator
type="QRCode"
value="https://appstore.com/myapp"
[qRCodeLogo]="{ imageSource: 'assets/app-icon.png', width: 40, height: 40 }"
[foreColor]="'#1976D2'"
width="250px"
height="250px">
</ejs-barcodegenerator>// Compact Data Matrix for pharmaceutical packaging
<ejs-barcodegenerator
type="DataMatrix"
[value]="medicineTrackingCode"
[displayText]="{ text: 'Product SKU: 123456789', visibility: true }"
width="80px"
height="80px">
</ejs-barcodegenerator>