Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Barcode number under the barcode image #4

Open
empitekrishan opened this issue Mar 20, 2018 · 0 comments
Open

Show Barcode number under the barcode image #4

empitekrishan opened this issue Mar 20, 2018 · 0 comments

Comments

@empitekrishan
Copy link

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();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant