Barcode being a string passed from the controller and displayed on the view:
@shelfEdge.Barcode
How do I get this to display in barcode format, just a matter of downloading a barcode font and adding it to the class?
any ideas welcome
UPDATE Ive used the post in Free Barcode API for .NET from Andrei Schneider...
BarcodeLib.Barcode barcode = new BarcodeLib.Barcode()
{
IncludeLabel = true,
Alignment = AlignmentPositions.CENTER,
Width = 300,
Height = 100,
RotateFlipType = RotateFlipType.RotateNoneFlipNone,
BackColor = Color.White,
ForeColor = Color.Black,
};
model.BarcodeImage = barcode.Encode(TYPE.CODE128B, "123456789");
then in view @Model.BarcodeImage
but this throws errro:
Compiler Error Message: CS0012: The type 'System.Drawing.Image' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Source Error:
Line 54: </td>
Line 55: <td width="30%">
Line 56: @Model.BarcodeImage
Line 57: </td>
Line 58: </tr>
and I have referenced system.drawing in project??