Dec 262012
 

Hello everyone!

As promised, this is the second post in the FAQ series. Today, we will be getting a bit more technical and diving into some questions regarding SDK code. Let’s get started!

1. I am trying to create a label with several objects but this seems difficult to do using the SDK APIs. I feel like I am creating my label the wrong way. How should I be creating my label using the SDK?

Although it is possible to layout a label entirely using our APIs, we recommend that you first create your label using DLS and then load this label with our API. For most SDK applications this approach should work well as it will reduce the amount of code for creating the label as well as allow you to edit the data on the label based on any user inputs. For instance, let’s say your were making an application that would create name badges for a conference your company was hosting. You could create a label in DLS with two text fields: one for name and one for company. Then, as attendees arrived at your conference registration table, you could simply type in the name and company of the attendee and your application would update the data on the label using our APIs and print out the name badge. See the code samples below to learn how to load the label and update the label data using both the older SDK and newer Framework. For the purpose of these examples, assume your label was named “NameBadge.label” and your name and company text objects were named “NameTxt” and “CompanyTxt”, respectively.

DYMO SDK

DYMO Label Framework

 DymoAddInClass _dymoAddin = new DymoAddInClass();
 DymoLabelsClass _dymoLabel = new DymoLabelsClass();
 _dymoAddin.Open("NameBadge.label");
 _dymoLabel.SetField("NameTxt", "John Smith");
 _dymoLabel.SetField("CompanyTxt", "Newell Rubbermaid");
 _dymoAddin.Print(1, false);
 var label = DYMO.Label.Framework.Label.Open("NameBadge.label");
 label.SetObjectText("NameTxt", "John Smith");
 label.SetObjectText("CompanyTxt", "Newell Rubbermaid");
 label.Print("DYMO LabelWriter 450 Turbo");

2. Every time I print to my Twin Turbo the label prints from the left tray. How can I print to the right tray?

Changing to the right (or second) tray is relatively simple in both the SDK and the Framework. However, it may be difficult to find this setting without knowing where to look. In the SDK, you simply specify a tray number (an integer) to indicate which tray to print to. You will use the Print2() method instead of Print(). In the Framework, there is an enum you use in conjunction with the LabelWriterPrintParams class. See the examples below.

DYMO SDK

DYMO Label Framework

 _dymoAddin.Print2(1, false, 1);

 The third parameter in the line above indicates 
 the tray number to use.
 LabelWriterPrintParams p = new LabelWriterPrintParams();
 p.RollSelection = RollSelection.Right;
 label.Print("DYMO LabelWriter 450 Turbo", p);

3. How can I create a tape (continuous) label using your SDK?

To create a continuous label, you must use the DYMO Label Framework. The older DYMO SDK does not support continuous labels. The layout mechanism of a continuous label is quite different than that of a die-cut. A continuous label uses a cell layout system instead of the fixed location system of a die-cut label. For example, if you were using a die-cut label and wanted to place three text objects side-by-side-by-side, you would manually set the location (x,y coordinates) of the three objects on the label.

DieCutExample

However, for a continuous label, you would need to add three subcells to the root cell of the label and then insert each of your text objects into one of the cells.

ContExample

Continuous labels are the simplest way to create a label on the fly. Continuous labels automatically size to their content (unless otherwise specified) and provide an organized layout system. Below is some sample code illustrating how to create the label displayed above using the DYMO Label Framework and continuous labels.

            ContinuousLabel label = new ContinuousLabel("Tape9mm", PaperOrientation.Landscape, ContinuousLabelLengthMode.Auto, 0);
            label.RootCell.Subcells.Add(new ContinuousLabelCell());
            label.RootCell.Subcells.Add(new ContinuousLabelCell());
            label.RootCell.Subcells.Add(new ContinuousLabelCell());

            label.RootCell.Subcells[0].LabelObject = new TextObject("Txt0");
            label.RootCell.Subcells[1].LabelObject = new TextObject("Txt1");
            label.RootCell.Subcells[2].LabelObject = new TextObject("Txt2");

            label.SetObjectText("Txt0", "This");
            label.SetObjectText("Txt1", "is a");
            label.SetObjectText("Txt2", "test.");

4. I would like my application to interface with a DYMO scale. Is there a DYMO scales SDK?

We do not provide an SDK for DYMO scales. Our scales conform to the HID standard and can be accessed this way. The HID standard for scales is documented in section 4 of this document. Jan Axelson has a useful page on HID development with plenty of examples. Nicholas Piasecki and Mike O’Brien also provide some useful resources on HID scale development.

That wraps up this second FAQ post. Hopefully all of you developers found these posts useful and continue to use our SDK and our printers.  I hope everyone enjoys the rest of this holiday season and has a happy New Year!

Dec 172012
 

Hello everyone! It’s been a while since we have had a new post here on the blog (other than occasional Firefox update post). We have been busy working on many new and exciting things that we are looking forward to sharing with you in the coming year! This past year has also seen a number of new products from DYMO including:

  1. Our first touch screen printer, the LabelManager 500TS
  2. A new handheld, the LabelManager 280
  3. An update to DLS to support our new printers (you can download it from here)

We thought we would wrap up the year with a post answering some of the most frequent SDK questions we receive. This will be a 2 part series with a second post coming later answering more of your FAQs. This first post will answer some of the more high level questions about getting your DYMO SDK app up and running. The second post will be a bit more technical. Without further ado, here we go!

1. I have downloaded and installed the DYMO SDK from this web page. However, I am unable to find or load the DYMO COM type library in my project. What am I doing wrong?

In fact, you really haven’t done anything wrong. There has just been a bit of miscommunication. The DYMO SDK installer (which can be found here) only installs samples, no binaries. To get the DYMO binaries, all you need to do is download and install the latest version of DLS (which can always be found here). Once DLS is installed, you should be able to find the type libraries as described in this post.

2. Is there a difference between the DYMO SDK and the DYMO Label Framework?

Yes. The DYMO SDK is our older API that is built using COM. You add references to our COM type libraries in your project and you’re off. The DYMO Label Framework is our newer API that we encourage all developers to use. The DYMO Label Framework is “native” to .NET, being written mostly in C#. You add references to our binaries in your project just as you would any 3rd party .NET library. The DYMO Label Framework also provides a greater feature set than the older DYMO SDK, which leads us to our next question.

3. I have downloaded and installed DLS and added a reference to the DYMO COM type library in my project. However, I cannot print to my tape printer using the SDK. What is going on?

The older DYMO SDK does not support printing to tape printers (i.e. the LabelManager series). It only supports printing to die-cut printers (the LabelWriter series). In order to print to a tape printer, you will have to switch to the newer DYMO Label Framework which supports both tape and die-cut printers. In fact, there are several other advantages to switching to the newer DYMO Label Framework. See the chart below.

 

DYMO SDK

DYMO Label Framework

.NET & COM support
 MC900072629[1]  MC900072629[1]
Die-cut printers
 MC900072629[1]  MC900072629[1]
Tape printers  MC900072629[1]
JavaScript API  MC900072629[1]
QR Code  MC900072629[1]
Web SDK (Beta)
 MC900072629[1]

That’s all for now. Keep checking back for the second part of this FAQ series where we will dive into the code and answer some questions that are a bit more technical. Happy holidays everyone!