VintaSoft Barcode .NET SDK 12.5
In This Topic
    Get barcode image as SVG image
    In This Topic
    Example: Here is an example that shows how to generate barcode in vector form as SVG image.
    /// <summary>
    /// Returns a barcode in vector form as System.Drawing.Drawing2D.GraphicsPath object.
    /// </summary>
    /// <param name="barcodeType">Barcode type.</param>
    /// <param name="barcodeValue">Barcode value.</param>
    /// <returns>A barcode in vector form as System.Drawing.Drawing2D.GraphicsPath object.</returns>
    public string GetBarcodeAsSvgImage(Vintasoft.Barcode.BarcodeType barcodeType, string barcodeValue)
    {
        // create the barcode writer
        Vintasoft.Barcode.BarcodeWriter barcodeWriter = new Vintasoft.Barcode.BarcodeWriter();
    
        // set barcode writer settings
        barcodeWriter.Settings.Barcode = barcodeType;
        barcodeWriter.Settings.Value = barcodeValue;
    
        // return barcode as SVG image
        return barcodeWriter.GetBarcodeAsSvgFile();
    }