Skip to content

Show Barcode number under the barcode image #4

@empitekrishan

Description

@empitekrishan

my problem is after barcode was generated it didn't show barcode number under the barcode image. I need to add that barcode number under it.

i think this is a feature request

Here is my code:

[HttpPost]
public ActionResult Index(string barcode)
{   
    BarcodeSymbology symbology = BarcodeSymbology.Code39C;
    BarcodeDraw drawObject = BarcodeDrawFactory.GetSymbology(symbology);

    var metrics = drawObject.GetDefaultMetrics(60);
    metrics.Scale = 1;

    var barcodeImage = drawObject.Draw(barcode, metrics);

    using (MemoryStream ms = new MemoryStream())
    {
        barcodeImage.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
        byte[] imageBytes = ms.ToArray();

        ViewBag.BarcodeImage = "data:image/png;base64," + Convert.ToBase64String(imageBytes);
    }
    return View();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions