what goes wrong with Dymo SDK at runtime

1.9k views Asked by At

I have a problem with the SDK of Dymo. To go back to basic, I made an ultimate simple program and label. Still I run into the same problem. I also tried on different PC’s, different Labels (so even a label with 1 line of text), etc. If you want.

Imports DymoSDK.Implementations
Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim dymoSDKLabel As DymoSDK.Implementations.DymoLabel
        Dim SelectedPrinter As String = "DYMO LabelWriter 450 Turbo"
        Dim copies As Integer = 1
        Dim barcodeGraphsQuality As Boolean = True
        dymoSDKLabel = New DymoLabel()
        dymoSDKLabel.LoadLabelFromFilePath("D:\sam\MotorAssembly_Verp_Individueel-70W Extra label.label")
        DymoPrinter.Instance.PrintLabel(dymoSDKLabel, SelectedPrinter, copies, barcodeGraphsQuality)
    End Sub
End Class

What happens: During debugging it runs perfectly and it prints without any problem. During runtime it gives the following error (on the same PC!): ERROR: Invalid label file: the Element DieCutLabel is not declared.

Of course I checked if this element is in the labelfile, and it is.. It is the main element that is made by the Dymo software……….

all Dll files etc are included in the setup package..

Anybody any idea?

2

There are 2 answers

0
Matt Westwick On

I had this same issue - it turned out to be my <PaperName> XML tag was not a valid "paper name". The <Id> tag and <PaperName> tag also have to match somehow.

All labels are validated against the label XML schema before they are printed, but that schema seems to be a black box that there exists no documentation for, so good luck designing to it.

How did I solve the issue? I just used the <PaperName> tag from the example here and manually set my label size using the <DrawCommands> tag. Works great!

<?xml version="1.0" encoding="utf-8"?>
  <DieCutLabel Version="8.0" Units="twips">
    <PaperOrientation>Landscape</PaperOrientation>
    <Id>Address</Id>
    <PaperName>30252 Address</PaperName>\
    <DrawCommands>
        <!--Width and height are in twips; 1440=1". So this is a 1" square label (30332) and not the 30252 address-->
        <RoundRectangle X="0" Y="0" Width="1440" Height="1440" Rx="270" Ry="270" />
    </DrawCommands>

    <ObjectInfo>
      <!--Your label element-->
    </ObjectInfo>
  </DieCutLabel>
0
Tim Stollberg On

Try to change:

...
<PaperName>11355 Multi-Purpose</PaperName>
...

to

...
<PaperName>30334 2-1/4 in x 1-1/4 in</PaperName>
...

The 30334 labels have the same dimensions as the 11355. Hope it helps someone.