我已将 DYMO 280 标签打印机连接到我的电脑并尝试从我的 C# .NET winforms 应用程序打印标签,但我遇到了一些关于 XML 标签的错误。
我正在使用 DYMO Label v8.0 创建标签模板。你能给我一些代码示例吗?我发现的大多数例子都已经过时了(从 2011 年到 2011 年)。
我已经DYMO.Label
从 NuGet 包安装并将.label
文件移动到我的源代码中。
下面是我尝试打印标签的代码:
var label = Label.Open(AppDomain.CurrentDomain.BaseDirectory + "data\\elsis.label");
label.SetObjectText("productCode", productCode);
label.SetObjectText("productPrice", productPrice);
label.Print("DYMO LabelManager 280");
</StackTrace><ExceptionString>System.Xml.Schema.XmlSchemaValidationException: The element 'TextObject' has invalid child element 'GroupID'. List of possible elements expected: 'HorizontalAlignment'.</ExceptionString></InnerException></InnerException></Exception></TraceRecord>
Exception thrown: 'DYMO.DLS.Runtime.DlsRuntimeException' in DYMO.DLS.Runtime.dll
An unhandled exception of type 'DYMO.DLS.Runtime.DlsRuntimeException' occurred in DYMO.DLS.Runtime.dll
Unable to load label template 'C:\Users\armav\source\repos\Elesis\Elesis\bin\Debug\data\elsis.label'