The JavaScript library is the same as the one posted in the DLS Windows release so the information in the following posts apply to the Mac version of the SDK. Keep in mind that the Web Service is built into this version.

Thanks again for everyone’s patience. We were not able to do a Beta on the Mac version but it contains all the feedback that we got from the Windows Beta. If there are any issues, please either post on the blog or send an email to sdkreply at newellco dot com. We’ll be monitoring both looking for issues and will try to respond to issues as quickly as possible. Keep in mind the more information that you include in your post/email, the better we will be able to help you.

It should be noted that the JavaScript Samples that are in older posts on the blog have not been updated to incorporate the web service correctly.

UPDATE

We’ve had some reports from our users that a reboot may be required for the DYMO Web Service to get properly configured. We are looking into this further. The way you know you are in a state that requires a reboot is as follows:

Click on the DYMO icon in the upper right on the top menu bar

Select Diagnose

If a dialog pops up and it complains about no ssl assigned to the port, you should reboot.

If you see a dialog that says “DYMO Label Web Service is running on port XXX”, then there could be a different issue.

We also know that you are interested in the Mac version. We have had a lot of issues getting the design to work on Mac OSX, we have hit a major milestone this week and we now have a release candidate for DLS 8.5.3 for the Mac. If everything passes, we should be able to release it within a work week.

As a note to all our patient customers, we really appreciate you and your patience. This has been a more difficult release than we had thought but it is finally happening. All we have now is the imminent MacOSX release. Thank you!

Update: Added link to new Javascript library version and added links to older posts for references

In the last blog, I started out with a simple label printing application using the DLS SDK. If you are planning on using the SDK, you’ll need to become familiar with two objects that will do the bulk of label printing work in your application. The first one the DymoAddin object, the other is the DymoLabels object. We will examine on the DymoAddin object in this post.

Background

The DymoAddin object got its name from the time when DYMO needed to create addins for 3rd party applications. Instead of re-writing all the label printing code in a separate library, then using the library to implement the 3rd party addins (like the DLS MS Office Addins, DLS ACT! Addin, DLS QuickBooks Addin), we simply added a COM interface to the DLS application so we can leverage the label printing functionality from the DLS application. The first interface exposed was called the IDymoAddin interface, and the object that implemented the interface was called the DymoAddin object.

There are many methods exposed in the IDymoAddin interface, however, only a part of it is really intended for the SDK. The methods that don’t fall in this group are there because we (i.e. DYMO) needed it to implement some functionality for the addins we write for other applications. Call it lack of planning or oversight, these methods and properties that are really meant for internal DYMO use are lumped together in the same IDymoAddin interface that is used for SDK applications. For the most part, you should avoid using these methods and properties in your application. But as you sit down to understand the DLS SDK and design your own application, you’ll likely find that these methods and properties are too specialized and are not needed for your SDK application.

But what are these functions and methods that you shouldn’t use? Instead of listing them here, I will instead focus on the methods that are meant to be used by SDK applications.

Main Functionality

In the last blog, I outlined the three main concepts used in the DLS SDK. The first is the concept of a label file. The main functionality of the DymoAddin object is to implement the IDymoAddin interface, which provides operations you can perform on a label file, including opening, saving, and printing a label file. Because printing is part of the functionality, the IDymoAddin interface also provides methods to list and select DYMO printers for use in your SDK application. I will explore these methods and their usage (in C#) below.

File Operations

The Open(), Save(), and SaveAs() methods combined to give you the ability to open and save labels on your computer’s local file system. The same operations can be used on network storage if the storage location is addressable using UNC (i.e. Universal Naming Convention).

The following example shows how to open a label file and then save it with a different file name:

Web Applications

Sometimes the label file you need is located in the cloud and you need to access it using an URL. The OpenURL() method is created for this purpose.

Proxy Server and Proxy Bypass

The OpenURL() method is implemented using WinInet. This means that the user’s proxy settings in IE is used when calling the OpenURL(). But depending on your application, this might not be desirable. You can use the following methods and properties to control proxy settings used for the OpenURL() method. These settings are good for the lifetime of the DymoAddinObject, but are not persistent beyond that. So if you free and create another instance of the DymoAddinObject, you will need to setup the custom proxy settings again for the next OpenURL call.

ProxyBypass property – set to True to bypass all proxy servers. When this property is set to True, it overrides all other proxy settings.

SetupProxySettings() method – setup custom proxy settings.

ClearProxySettings() method – clear all proxy settings and revert back to using IE’s proxy settings.

Database Operations

If your application uses a database to store label files, you can use the OpenStream() and SaveStream() methods to open and save label files using memory buffers.

The following example shows how to open and save label files into memory buffers:

1 privatevoidOpenAndSaveStreamExample() 2 { 3 DymoAddInClass _dymoAddin =newDymoAddInClass(); 4 5 // this is the buffer that will hold an array of bytes 6 object buf =null; 7 8 if(_dymoAddin.Open(System.IO.Path.Combine( 9 System.IO.Directory.GetCurrentDirectory(),10 @"DatabaseLabel.label")))11 {12 // get an array of bytes from Save Stream13 buf = _dymoAddin.SaveStream();14 15 // at this point, you can store buf as a blob16 // in your database17 byte[] blob = (byte[])buf;18 }19 20 // to open a label file from a blob in your database21 // first, read the blob into into an array of bytes22 // then pass the array of bytes to OpenStream23 System.IO.MemoryStream ms =new System.IO.MemoryStream();24 25 // the following line is psuedo code aimed to illustrate how one26 // might read a blob into an array of bytes27 !!!Database.Table("Labels Table").Field("Shipping Label").SaveToStream(ms);28 29 // at this point, you can read the bytes30 _dymoAddin.OpenStream(ms.GetBuffer());31 }32

Printer Related Operations

The DLS SDK (and therefore your SDK applications) can only be used with LabelWriter printers. Because of this, we added printer listing and selection methods to filter out printers that are not compatible with the DLS SDK so your application will not need extra code to deal with printer compatibility and selection issues.

The following example shows how to get a list of LabelWriter printers installed on the computer, and selects a printer named “My LabelWriter” to print a label file:

A new method worth mentioning is the IsPrinterOnline() method, which return the online/offline status of a printer.

Conclusion

Although the DymoAddin object’s name may not invoke any ideas of the functionality it provides, it is an important part of the because of the rich features it provides. I hope this blogs gives you a good idea of the DymoAddin object’s capabilities and how to best use the capabilities for your specific application.