Export in Blazor Barcode Component

Export

Blazor Barcode provides support to export its content as an image in the specified image type and downloads it in the browser.

@using Syncfusion.Blazor.BarcodeGenerator

<input type="button" value="Export" @onclick="@OnExport" />
<SfQRCodeGenerator Width="200px" Height="150px" Value="Syncfusion" @ref="@QRcode" >
    <QRCodeGeneratorDisplayText Text="Text"></QRCodeGeneratorDisplayText>
</SfQRCodeGenerator>
@code{
    SfQRCodeGenerator QRcode;
    private void OnExport() {
        QRcode.Export("fileName", BarcodeExportType.JPG);
    }
}

ExportAsBaseImage

Barcode provides support to export as an image in the specified image type and returns it as base64 string.

@using Syncfusion.Blazor.BarcodeGenerator

<input type="button" value="Export" @onclick="@OnExport" />
<SfQRCodeGenerator Width="200px" Height="150px" Value="Syncfusion" @ref="@QRcode">
    <QRCodeGeneratorDisplayText Text="Text"></QRCodeGeneratorDisplayText>
</SfQRCodeGenerator>

@code
{
    SfQRCodeGenerator QRcode;

    private async void OnExport()
    {
        await QRcode.ExportAsBase64Image(BarcodeExportType.JPG);
    }
}

NOTE

Format specifies the image type of the exported file. The following export formats are supported:

* JPG.

* PNG.