How could Printer Code Template Field passed data correctly form c# with .NET SDK?
I write a demo to test Printer Code Template Filed for passing data from c# with .NET SDK.
Bartender Desinger version is 11.0.1.3045 (32-bit).
Here is my test code and lable template.
var lb = @"C:\Users\Administrator\Desktop\线标.btw";
using (Engine engine = new Engine(true))
{
LabelFormatDocument btformate = engine.Documents.Open(lb);
btformate.SubStrings["version"].Value = txtVersion.Text;
btformate.SubStrings["pn"].Value = txtPN.Text;
btformate.SubStrings["sn"].Value = txtsn.Text;
btformate.SubStrings["week"].Value = txtWeek.Text;
btformate.PrinterCodeTemplate.Performance.AllowVariableDataOptimization = true;
btformate.ExportImageToClipboard(Seagull.BarTender.Print.ColorDepth.ColorDepth256, new Resolution(200));
engine.Stop();
}
I mean to pass data from c# with string formate,but Bartender regard it as numper and add ',' or '.00'
How can I adjust my template for passing string instead of number? i can't find any option for that.
Thanks a lot.
-
Ye Zhao
★ BarTender Hero ★
Anyone can help? Thanks~
1 -
Jimmy
★ BarTender Hero ★
Personally , I recommend dictionary or something close.
Like add pair of string into a dictionary with key (source) and value , then SetSubString with foreach like below
foreach (var node in Dictionay)
{
btformat.SubStrings.SetSubString(node.Key, node.Value);
}Never ran into the problem u've got , so maybe you can try it out.
0
請登入寫評論。
評論
2 條評論