Mar 232010
 

DYMO Label Software v.8 has a lot of compelling features from a developer’s point of view. One important change is the new label file format.

In most cases knowing the file format is not necessary because DYMO Label Software (DLS) can be used to design a label visually. However, there are advanced scenarios where knowing the file format can benefit applications that use the DYMO Label SDK. Some of these advanced scenarios are:

  • Using features not available through the DYMO Label Software UI
  • Using features not available through the DYMO Label SDK
  • Generating label files on the fly
  • Creating label files for custom labels

In a series of blog posts we will describe the internals of label file format.

In DYMO Label v.8 we made several improvements to make using label files easier:

  • The label file format is cross-platform; both Windows and Mac versions of DYMO Label Software use the same file format and shared the same built-in layouts. Because file format is the same it is easier to create applications target different platform, e.g. web-based applications.
  • The label file format is XML-based. So the content of a label can be examined by just looking at the label’s XML or by using any XML tool. Also, this allows using any XML API to manipulate label content directly in case the corresponding functionality is unavailable in the DYMO Label SDK or direct manipulation is more convenient in this particular case.
  • The label file format is the same for die-cut labels such as Address or Shipping and for tape/continuous labels such as 12-mm or 19-mm tapes. Strictly speaking the format is not the same but both formats shared some common parts, so it is still easier to use.

So, let look at a sample label that in DYMO Label Software looks like

01 xml version="1.0" encoding="utf-8"?>
02 <DieCutLabel Version="8.0" Units="twips">
03     <PaperOrientation>Landscape</PaperOrientation>
04     <Id>Address</Id>
05     <PaperName>30252 Address</PaperName>
06     <DrawCommands>
07         <RoundRectangle X="0" Y="0" Width="1581" Height="5040" Rx="270" Ry="270" />
08     </DrawCommands>
09     <ObjectInfo>
10         <TextObject>
11             <Name>Text</Name>
12             <ForeColor Alpha="255" Red="0" Green="0" Blue="0" />
13             <BackColor Alpha="0" Red="255" Green="255" Blue="255" />
14             <LinkedObjectName></LinkedObjectName>
15             <Rotation>Rotation0</Rotation>
16             <IsMirrored>False</IsMirrored>
17             <IsVariable>True</IsVariable>
18             <HorizontalAlignment>Center</HorizontalAlignment>
19             <VerticalAlignment>Middle</VerticalAlignment>
20             <TextFitMode>ShrinkToFit</TextFitMode>
21             <UseFullFontHeight>True</UseFullFontHeight>
22             <Verticalized>False</Verticalized>
23             <StyledText>
24                 <Element>
25                     <String>Click here to enter text</String>
26                     <Attributes>
27                         <Font Family="Arial" Size="20" Bold="False" Italic="False" Underline="False" Strikeout="False" />
28                         <ForeColor Alpha="255" Red="0" Green="0" Blue="0" />
29                     </Attributes>
30                 </Element>
31             </StyledText>
32         </TextObject>
33         <Bounds X="331" Y="150" Width="4560" Height="1343" />
34     </ObjectInfo>
35 </DieCutLabel>
02 <DieCutLabel Version="8.0" Units="twips">

Line #2 specifies label type as well as version and measurement units. The label type is DieCutLabel, one of two label types currently supported by DYMO Label. DieCutLabel as well as other label type ContinuousLabel will be described with details in a separate blog post. Version=”8.0″ specifies file format version. This version is independent from the version of DYMO Label Software. Currently the only valid version for label file is “8.0” for all versions of DYMO Label Software v.8 up to the latest version, 8.2.1.913. Units=”twips” specifies measurement units used in the file for values like object position or border width. The only supported units for now are “twips” where 1 ‘twip’ is 1/1440 of inch. Other units might be added in future version of DYMO Label. “Twips” are used basically because of “historical” reasons; previous versions of DYMO Label Software used this unit.

03     <PaperOrientation>Landscape</PaperOrientation>
05     <PaperName>30252 Address</PaperName>

Lines #3, #5 specify paper to use to print the label. In this case it is “30352 Address” paper in Landscape orientation. Paper name should be a paper defined by printer driver.

04     <Id>Address</Id>

Line #4 specifies a label ID – a unique identifier for a label type. Basically this ID is used by DYMO Label Software to lookup additional business-related information about the label like available packaging, buy links, etc. It is OK to have ID to be set to empty string if the label is not going to be used from DYMO Label Software.

06     <DrawCommands>
07         <RoundRectangle X="0" Y="0" Width="1581" Height="5040" Rx="270" Ry="270" />
08     </DrawCommands>

Lines ##6-8 specify commands used to draw label’s shape, in this case a rounded rectangle. Again, if a label is created on the fly and intended to be printed only, the commands can be omitted.

Lines ## 9-34 specify position and properties for the only text object on the label. More information about objects will be provided in following posts.

The complete xml schema for the label file format is available on http://www.labelwriter.com/software/dls/sdk/LabelFile.xsd

  25 Responses to “Understanding Label File Formats in DYMO Label v.8 – Overview”

  1. What reference do I need to set to get your sample code to work in vb.net?

    Framework SDK (sample written in VB.NET)
    Private Label As DYMO.Label.Framework.ILabel
    Label = DYMO.Label.Framework.Framework.Open(“c:Documents and SettingsAll
    UsersDocumentsDYMO LabelLabel FilesTestLabel.label”)
    Label.SetObjectText(“TEXT1”, “Testing, testing”)
    Label.Print(“DYMO LabelWriter 450 Turbo”)

  2. A Sample for Delphi would be great. There was a TLB file released for the earlier SDK, and samples… but nothing for v8?

    • You can use old SDK samples, they should work as is. As for the TLB – you can either use the old one, or extract type information from DLS8BackwardCompatibilityCOMLib.dll directly (it is installed in the DYMO Label software installation folder)

      • Been on this a good part of the day, with no luck. Samples will NOT accept a .label file. I’ve tried multiple solutions including re-generating TLB files, no luck.

        Here is what happens, I can take a lwl file and open it with v8 software, it converts internally to a .label file (see title bar) and when I attempt a ‘SaveAs’, the only option is .label.

        The label will not load with a DL.Open (odLabelFile.FileName)

        I’m stuck and ready to throw in the towel… any help?

  3. Thats the solution. Thank you very much.

  4. One More. The method: DymoAddIn.Show; is not executing the label editor.
    Suggestions?

  5. Remarkable! Its in fact awesome paragraph, I have got much clear idea
    regarding from this piece of writing.

  6. Where can I find a list of valid PaperName values? I am trying to print something for the 30370 Multi-Purpose labels but it’s not printing anything

    • Can you print your label from latest DLS?
      You could check valid paper names with steps follow: Control panel -> Administrative tools -> Printmanagement -> Check list of papers under Forms in Print Servers.

  7. We’ve been using DYMO label printers for years and years. We have a few in our warehouse, and years ago I wrote a few web pages that help them to create product labels on the DYMOs. I find myself in the position of having to rewrite them (Windows has evolved, and the printers have evolved), and this article is a great starting point. Thanks.

  8. I want to load .lwl file with the help of javascript ,

    how could i change the values of address object values Dynamically in javascript

    Address

    Rotation0
    False
    True
    Left
    Middle
    ShrinkToFit
    True
    False

    Click Here to Enter Address

    False
    Suppress

  9. how can I convert Mac files to work with my Dymo Labelwriter 450 Turbo. Can’t seem to access Mac derived files ( Numbers spreadsheet converted to CSV)

    • William,

      What exactly are you trying to do with these files? Are you trying to open them in a DYMO SDK application and place the data onto a label?

  10. Cannot open labels created in Dymo ver 8.6 in ver 8.5. Is this possible? Is there a workaround?

  11. Hi,
    we are using this code listed below to print out labels, the problem i am experiencing is that the label prints from the software over two labels in the printer.

    i was given a different dimension from dymo
    which is apparently relating to the papper we use in the printer which has art work number of 11354 which they said is medium size.

    I have tried this and did not work. can you assist me in anyway.

    version=”1.0″ encoding=”utf-8″?>

    Landscape
    Address
    30252 Address

    many thanks

    • it didnt take the code in the msg.

      version=”1.0″ encoding=”utf-8″?>

      Landscape
      Address
      30252 Address

    • What printer are you using? What is the SKU for the paper you have inserted?

      • Hi thanks for replying.

        the printer im using is a dymo labelwriter 450 the paper im using is Dymo 11354 Multi purpose Labels (S0722540).

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)