條形碼是由控制器通過並顯示在視圖中的字符串:如何產生鑑於條形碼
@shelfEdge.Barcode
我如何得到這個條形碼格式顯示,僅下載條形碼字體的事並將其添加到課堂?
任何想法表示歡迎
UPDATE 伊夫使用後在Free Barcode API for .NET從安德烈·施耐德...
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");
然後在視圖@Model.BarcodeImage
但是,這將引發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>
和我有引用system.drawing項目??
您需要使用第三方組件(ComponentOne的,閱讀Aspose等) – Mahmoodvcs
你可以嘗試用syncfusion條碼 – SivaRajini
感謝您的回覆球員,請參閱編輯....誰投了-1請解釋你的理由? – John