Class SfDotCodeGenerator
Represents a component that renders a standalone DotCode symbol.
Inheritance
Inherited Members
Namespace: Syncfusion.Blazor.BarcodeGenerator
Assembly: Syncfusion.Blazor.BarcodeGenerator.dll
Syntax
public class SfDotCodeGenerator : SfBaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Constructors
SfDotCodeGenerator()
Declaration
public SfDotCodeGenerator()
Properties
BackgroundColor
Gets or sets the DotCode background color.
Declaration
[Parameter]
public string BackgroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A CSS color value. The default is |
ChildContent
Gets or sets nested DotCode configuration components.
Declaration
[Parameter]
public RenderFragment? ChildContent { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment | A render fragment containing margin and display-text configuration. |
DisplayText
Gets or sets the display-text configuration.
Declaration
[Parameter]
public DotCodeDisplayText DisplayText { get; set; }
Property Value
| Type | Description |
|---|---|
| DotCodeDisplayText | A DotCodeDisplayText containing the text settings. |
EnableGS1
Gets or sets whether the value is parsed as a GS1 element string.
Declaration
[Parameter]
public bool EnableGS1 { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
ForeColor
Gets or sets the DotCode foreground color.
Declaration
[Parameter]
public string ForeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A CSS color value. The default is |
Height
Gets or sets the rendered symbol height.
Declaration
[Parameter]
public string Height { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A CSS dimension. The default is |
Margin
Gets or sets the symbol margin configuration.
Declaration
[Parameter]
public DotCodeMargin Margin { get; set; }
Property Value
| Type | Description |
|---|---|
| DotCodeMargin | A DotCodeMargin containing the symbol margins. |
OnValidationFailed
Occurs when DotCode validation fails.
Declaration
[Parameter]
public EventCallback<ValidationFailedEventArgs> OnValidationFailed { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<ValidationFailedEventArgs> | A callback that receives validation details. |
Value
Gets or sets the value encoded into the DotCode symbol.
Declaration
[Parameter]
public string Value { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The text or GS1 element string to encode. |
Width
Specifies the width of the Dotcode. By default, it is set to 100%.
Declaration
[Parameter]
public string Width { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Accepts the string value. The default value is |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
Export(string, BarcodeExportType)
Exports the DotCode symbol as an image and downloads it in the browser.
Declaration
public void Export(string fileName, BarcodeExportType exportType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | Specifies the filename of the DotCode image to download. |
| BarcodeExportType | exportType | Specifies the image type used for the export. |
ExportAsBase64Image(BarcodeExportType)
Exports the DotCode symbol as an image and returns it as a base64 string.
Declaration
public Task<string> ExportAsBase64Image(BarcodeExportType exportType)
Parameters
| Type | Name | Description |
|---|---|---|
| BarcodeExportType | exportType | Specifies the image type used for the export. |
Returns
| Type | Description |
|---|---|
| Task<string> | The base64-encoded image. |
OnAfterRenderAsync(bool)
Runs after the DotCode component has rendered.
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | firstRender | Whether this is the first render. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous rendering operation. |
Overrides
OnInitializedAsync()
Initializes the DotCode component and registers its script module.
Declaration
protected override Task OnInitializedAsync()
Returns
| Type |
|---|
| Task |
Overrides
OnParametersSetAsync()
Handles parameter updates for the DotCode component.
Declaration
protected override Task OnParametersSetAsync()
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous parameter update operation. |