4

I've connected DYMO 280 Label Printer to my pc and trying to print labels from my C# .NET winforms application but I'm facing some errors regarding XML tags.

I'm using DYMO Label v8.0 to create a label templates. Can you pls send me some code examples? Most of the examples I've found are really outdated (from 2011,2011).

I've installed DYMO.Label from NuGet packages and moved the .label file to my source code.
Below is the code I've tried to print the labels:

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'
colinD
  • 1,641
  • 1
  • 20
  • 22
Arman Avetisyan
  • 349
  • 2
  • 10
  • I don't know about DYMO but it looks like there is an error in the label file. Apparently there is an element `TextObject` containing a child `GroupID` which is invalid for this kind of element. Is there any documentation you could look at? – colinD Aug 14 '19 at 12:28
  • 1
    Crazy guess: is `data\\elsis.label` perhaps a typo? - since you have `ElEsis (my emphasis) in the path. – 500 - Internal Server Error Aug 14 '19 at 13:24
  • Yeah the file exists for sure. It's just wrong name. Also I've modified the XML to remove that GorupID but next it gives me another similar error. – Arman Avetisyan Aug 14 '19 at 14:46
  • Hey @ArmanAvetisyan did you found any solution. I have same problem. I can print from label designer software but when i try to print from C# ( using same code as in your question ) it gives me error something like "Unable to load label template" – Jaydeep Karena Dec 04 '19 at 09:21
  • I am facing the same problem! – Nandostyle Jul 18 '21 at 22:36

1 Answers1

0

It's an old question, but incase anyone else has this problem, I faced this issue with the supplied C# examples.

The reason was the .dll files were not copying into the bin (even though I had the software installed on my PC) Once I copied the dymo framework DLL's (Interop.DYMOBarcodeLib.dll) it worked.

Michael
  • 8,229
  • 20
  • 61
  • 113