Jun 022010
 

DYMO has just released a beta version of DYMO Label Framework – a new set of APIs to work with DYMO LabelWriter and LabelMANAGER printers. In this post we will briefly look at different parts of the Framework.

Installation

All needed libraries and binaries are installed by DYMO Label v.8 installer. On Windows you will need to install version 8.2.3.1026 or later available on http://download.dymo.com/download/Win/DLS8Setup.8.3.1.1332.exe http://www.labelwriter.com/software/dls/win/DLS8Setup.8.2.3.1026-BETA.exe. Note: THIS IS A BETA VERSION for developers only. Please don’t install it on customer’s machines.  On Mac DYMO Label version 8.2.2.1173 or later should be installed. It is available on http://www.labelwriter.com/software/dls/mac/DLS8Setup.8.2.2.1173.dmg. Documentation and samples are installed by DYMO Label SDK installer available on http://www.labelwriter.com/software/dls/win/DYMO_Label_v.8_SDK_Installer.exe.

APIs

The Framework supports the following environments: .NET, COM, and JavaScript. The .NET and COM APIs are similar to high-level and low-level SDK APIs in the current API. JavaScript is a new API to be used from a web-browser.

.NET

The Framework itself is almost completely written in C#, so .NET is “natively” supported. To start using it just reference DYMO.Label.Framework assembly. Below is a simple example shows how to print an address label.

var label = DYMO.Label.Framework.Label.Open(@“c:Address.label”);
label.SetObjectText(“Address”, “DYMOn828 San Pablo AvenAlbany CA 94706”);
label.Print(“DYMO LabelWriter 450 Turbo”);

A compete C# sample is available on DYMO Label Framework/samples/C# Sample subfolder of the SDK installation folder. A VB.NET sample is available on DYMO Label Framework/samples/VB Sample subfolder.

COM

Thanks to .NET-to-COM-interop, Framework can be used from any language/platform that supports COM, e.g. Visual C++, Delphi, or VB6. The API is similar to the .NET one. E.G. the above example in C++ will look like this:

#import “DYMOLabelFramework.tlb”
using namespace DYMO_Label_Framework;
IFrameworkPtr framework (__uuidof(Framework));
ILabelPtr label = framework->OpenLabel(L“c:\Address.label”);
label->SetObjectText(L”Address”, L“DYMOn828 San Pablo AvenAlbany CA 94706”);
IPrintParamsPtr printParams = abelWriterPrintParams(__uuidof(LabelWriterPrintParams));
label->Print(framework->GetPrinterByName(L”DYMO LabelWriter 450 Turbo”), printParams); 

JavaScript

Prior to the the introduction of the Framework API DYMO had limited support for accessing printers from web-browsers. Although major browsers (IE, Firefox, Safari on Mac) were supported, the burden of browsers’ incompatibility was on the developers side. That has changed now. Not only more browsers are supported now (IE, IE 64-bit, Firefox, Chrome, Opera, Safari on Windows, Safari on Mac) but the Framework provides a cross-browser and cross-platform pure JavaScript API. The above samples will look like this (in any supported browser):

$.get(http://myserver.com/Address.label, function(labelXml)
{
    var label = dymo.label.framework.openLabelXml(labelXml);
    label.setObjectText(“Address”, “DYMOn828 San Pablo AvenAlbany CA 94706”);
    label.print(“DYMO LabelWriter 450 Turbo”);
});

Note 1: using of jQuery library ($.get function) is just for this sample only. The Framework JavaScript library itself does not have dependencies on any other libraries.

Conclusion

DYMO Label Framework allows easy label printing in many different environments. The APIs provided by the Framework will be explored in more detail in upcoming posts.

May 252010
 

Update: DYMO Label software 8.3 has been released. See http://developers.dymo.com/2011/01/13/announcing-dymo-label-8-3/

Update 2: DYMO Label SDK 8.3.1 has been released. See http://developers.dymo.com/2011/12/02/announcing-dymo-label-sdk-8-3-1/

Please Note

This release is a BETA. It has not been extensively tested outside DYMO and should be used for developer testing only, NOT for production software releases.

What’s New

64-bit Support

Now you can use the SDK from 64-bit processes, e.g. Internet Explorer 64-bit. The only thing to do is to recompile your application to be 64-bit, no need to change any code.

New DYMO Label Framework API

Starting this introduces a new API – the DYMO Label Framework. It provides a simpler streamlined interface for printing labels.

Major Features

  • Support for 32-bit and 64-bit applications.
  • Support for Tape printers. Now you can use the same simple API to print on Tape printers as for printing on LabelWriter printers. All you need to do is to design a Tape label in DLS, load it in your application and print.
  • Native .NET support. The Framework provides native .NET support. There is no need to use COM-Interop anymore. Features available in .NET such as indexed properties, enumerators, etc are used to provide an API that is easier to use.
  • COM support. Microsoft COM is supported as well, similar to current SDK.
  • Consolidated High and Low Level API. The Framework combines the current high-level and low-level APIs into a single API. Now there is no need to switch between APIs if you need some advanced functionality not available in high-level API.
  • Cross-browser and cross-platform JavaScript library – see below.

DYMO Label Framework JavaScript Library

To simplify using DYMO Label SDK from web-based application we created a JavaScript library that abstracts browser and platform details for accessing DLS SDK from JavaScript. Now you can use the same JavaScript code to add printing support for any browser the SDK supports. Currently supported browsers are:

  • On Windows: Internet Explorer 6+, Firefox 2+, Chrome 4, Opera 10, Safari
  • On Mac: Safari 3+

Major Features

  • Simple cross-browser and cross-platform API
  • Ability to load and print a label from: a web server, the local file system, or construct on the fly in JavaScript
  • Ability to load images from the server or from local file system
  • Ability to print multiple labels at once

Samples are available on “DYMO Label Framework/Samples/JavaScript” subfolder of the root SDK installation folder. Extensive documentation is provided at the top of the DYMO.Label.Framework.js file.

SDK Installation

The SDK libraries are installed by the DYMO Label 8.2.3 installer. It installs BOTH the DLS SDK (32 and 64 bit) and the new DYMO Label Framework along with drivers and the DYMO Label application.

Windows DYMO Label v.8 Installer

http://www.labelwriter.com/software/dls/win/DLS8Setup.8.2.3.1026-BETA.exe

http://download.dymo.com/download/Win/DLS8Setup.8.3.1.1332.exe

SDK Installer (Documentation and Samples)

http://www.labelwriter.com/software/dls/win/DYMO_Label_v.8_SDK_Installer.8.2.3.123-BETA.exe

http://www.labelwriter.com/software/dls/win/DYMO_Label_v.8_SDK_Installer.exe