syncfusion-blazor-barcode
Build and troubleshoot barcode generation in Blazor using SfBarcodeGenerator, SfQRCodeGenerator, and SfDataMatrixGenerator. Trigger for 1D barcodes (Code39, Code128, Codabar), QR codes with logo and error correction, Data Matrix, checksum validation, and exporting barcodes to images in Syncfusion Blazor apps.
What this skill does
# Syncfusion Blazor Barcode Generator
Syncfusion's Blazor Barcode Generator package (`Syncfusion.Blazor.BarcodeGenerator`) provides three components for generating barcodes in Blazor applications:
| Component | Use For |
|-----------|---------|
| `SfBarcodeGenerator` | 1D linear barcodes (Code39, Code128, Codabar, etc.) |
| `SfQRCodeGenerator` | QR codes with optional logo embedding |
| `SfDataMatrixGenerator` | 2D Data Matrix codes for compact encoding |
All three work in **Blazor Server**, **Blazor WebAssembly**, and **Blazor Web App** (.NET 8+).
---
## When to Use This Skill
- User needs to render or display a barcode in a Blazor component
- User asks about QR code generation (e.g., product links, 2FA, contact cards)
- User needs Data Matrix codes (pharmaceutical, logistics, label printing)
- User is configuring `SfBarcodeGenerator`, `SfQRCodeGenerator`, or `SfDataMatrixGenerator`
- User asks about exporting a barcode as an image (JPG/PNG) or Base64
- User asks about barcode types, error correction, checksums, or validation events
- User is embedding a logo in a QR code
---
## Navigation Guide
### Setting Up the Project
๐ **Read:** [references/getting-started.md](references/getting-started.md)
- NuGet package installation
- `_Imports.razor` namespace configuration
- Service registration in `Program.cs`
- Stylesheet and script references
- Setup for Blazor Server, WebAssembly, and Web App
- Adding the first barcode component to a page
### 1D Barcode Types and Configuration
๐ **Read:** [references/barcode-types.md](references/barcode-types.md)
- All supported `BarcodeType` enum values with descriptions
- Code39, Code39 Extended, Code11, Code32, Code93, Codabar, Code128
- Choosing the right type for your use case
- `EnableCheckSum` configuration
- `OnValidationFailed` event handling
### QR Code Generator
๐ **Read:** [references/qr-code-generator.md](references/qr-code-generator.md)
- Basic QR code usage
- Error correction levels (L, M, Q, H)
- Embedding a logo image in the QR code center
- Customizing logo size
- Color, dimension, and display text customization
- `OnValidationFailed` event
### Data Matrix Generator
๐ **Read:** [references/data-matrix-generator.md](references/data-matrix-generator.md)
- Basic Data Matrix code usage
- Color, dimension, and display text customization
- Common use cases (pharmaceuticals, labels)
- `OnValidationFailed` event
### Exporting and Customizing Barcodes
๐ **Read:** [references/export-and-customization.md](references/export-and-customization.md)
- Export barcode to image file (JPG/PNG)
- Export as Base64 string
- `ForeColor` for custom barcode color
- `Width` / `Height` for sizing
- `BarcodeGeneratorDisplayText` for label text
- Applies to all three generator types
---
## Quick Start Examples
### 1D Barcode
```razor
@using Syncfusion.Blazor.BarcodeGenerator
<SfBarcodeGenerator Width="200px" Height="150px"
Type="@BarcodeType.Code128"
Value="SYNCFUSION">
</SfBarcodeGenerator>
```
### QR Code
```razor
@using Syncfusion.Blazor.BarcodeGenerator
<SfQRCodeGenerator Width="200px" Height="200px"
Value="https://www.syncfusion.com">
</SfQRCodeGenerator>
```
### Data Matrix
```razor
@using Syncfusion.Blazor.BarcodeGenerator
<SfDataMatrixGenerator Width="200" Height="150"
Value="SYNCFUSION">
</SfDataMatrixGenerator>
```
---
## Key Properties
| Property | Applies To | Description |
|----------|-----------|-------------|
| `Value` | All | The data string to encode |
| `Width` | All | Width of the barcode (px or %) |
| `Height` | All | Height of the barcode (px or %) |
| `Type` | `SfBarcodeGenerator` | `BarcodeType` enum โ selects the 1D symbology |
| `ForeColor` | All | Color of the barcode bars (e.g., `"red"`, `"#333"`) |
| `EnableCheckSum` | `SfBarcodeGenerator` | Adds/validates checksum digit (default `true` for Code39) |
| `ErrorCorrectionLevel` | `SfQRCodeGenerator` | QR error recovery: Low, Medium, Quartile, High |
| `OnValidationFailed` | All | Event triggered when `Value` contains invalid characters |
---
## Common Use Cases
| Need | Component | Read |
|------|-----------|------|
| Product/inventory labels | `SfBarcodeGenerator` (Code128/Code39) | barcode-types.md |
| URL / contact / 2FA QR code | `SfQRCodeGenerator` | qr-code-generator.md |
| Branded QR code with logo | `SfQRCodeGenerator` + `QRCodeLogo` | qr-code-generator.md |
| Pharmaceutical / shipping labels | `SfDataMatrixGenerator` | data-matrix-generator.md |
| Download barcode as image | `.Export()` method | export-and-customization.md |
| Embed barcode in email/PDF | `.ExportAsBase64Image()` | export-and-customization.md |
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.