【发布时间】:2018-09-24 06:25:22
【问题描述】:
我无法解决我的条形码问题。我在 Excel 中传递我的文件中的字符串,例如 51453125312453。我在我的模型中使用 Spire.Barcode,就像这样
private void GenerateBarcode()
{
BarcodeSettings st = new Spire.Barcode.BarcodeSettings();
st.Code128SetMode = Spire.Barcode.Code128SetMode.Auto;
//st.Data = Ilosc.ToString("F6") + "*" + Partia;
st.TextFont = new System.Drawing.Font("Arial", 16);
st.ShowTopText = false;
st.ShowTextOnBottom = true;
st.ImageWidth = 100;
Spire.Barcode.BarCodeGenerator bg = new Spire.Barcode.BarCodeGenerator(st);
HeaderBarcode = bg.GenerateImage().ToString();
//bg.GenerateImage();
}
和我的字符串
private string headerBarcode;
public string HeaderBarcode
{
get
{
return headerBarcode;
}
set
{
if (headerBarcode != value)
{
headerBarcode = value;
GenerateBarcode();
NotifyPropertyChanged(nameof(HeaderBarcode));
}
}
}
在我的打印预览中有这个 System.Drawing.Bitmap 而不是条形码。你能帮我解决这个问题吗?
【问题讨论】:
标签: c# barcode barcode-printing