Apr 052011
 

We are proud to announce a BETA release of the DYMO Label Web SDK. The DYMO Label Web SDK contains enhancements to DYMO Label software and the DYMO Label Framework JavaScript library to allow printing from a web browser running on any modern computing platform. This includes any desktop browser running on Windows, Mac, or Linux; mobile browsers on iPhone, iPod, iPad, Android, BlackBerry and even on Kindle :)

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.

Architecture Overview

Before going into details let first look at the high level architecture for the Web SDK to understand how it works.

For the current SDK the architecture looks like this:

SDK1

So, only PC and Mac are supported. DYMO Label software has to be installed on each machine that uses the JavaScript library.

The architecture for the Web SDK is like this:

SDK2

The major piece here is a computer that has a DYMO printer plugged-in and DYMO Label software installed. DYMO Label software contains a service called DYMO Label Proxy that allows communication between a web browser and the printer. Nothing should be installed on any other computing device that accesses the printer. That is the biggest difference from the current SDK where DYMO Label software must be installed on any client computer that needs label printing functionality.

Notes:

  • right now DYMO Label Proxy is available for Windows only. So, a printer should be connected to a Windows machine, or be available from Windows machine has DYMO Label Proxy installed (see below).
  • the printer itself does not have to be connected directly to the computer running DYMO Label Proxy. The printer has to be ACCESSIBLE from that machine. This means that the printer might be really connected to a different machine and be a "shared" network printer. Or the printer might be connected to a DYMO Print Server and be "installed" on the computer using RAW TCP/IP port. This might be used to simplify installation (see below).
  • a local network is used for communications between the proxy service and a mobile device. That means that on the mobile device the Wi-Fi should be turned on and the device should be connected to the network. Using just 3G is not enough.
  • browsers that use an internal “proxy” servers to fetch internet content, e.g. Opera Mini, are not supported. The reason? It is impossible to contact “local network” servers like DYMO Label Proxy from such browsers.

Usage Scenarios

The first scenario is printing from a computing device that DYMO Label cannot be installed on. This includes a mobile device like an iPad or Android as well as a desktop PC running e.g. Linux.

The second scenario is to simplify installation on Windows. Before now DYMO Label has to be installed on a PC you wanted to print from. Not any more :) Let say you want to be able to print to a “shared” printer connected to a different machine. E.g. the printer can be connected to a “server” or someone’s workstation in a common location, like a "front desk". In this case DYMO Label has to be installed only on the "server" and nothing should be installed on your local PC, even drivers.

Installation

The installation is fairly simple. Just install DYMO Label software, that’s it. DYMO Label Proxy service will be installed and run as a part of the installation. DYMO Label Proxy is a service running on port 8631 by default. Because of that there are couple of considerations  that must be taken into account:

  • DYMO Label Software will configure Windows Firewall to open the port 8631 for inbound requests. If a different firewall monitor is installed, you have to configure it manually.
  • The port number may be changed from the default one. Either use the configuration utility included or specify the port manually in the service’s application .config file. In any case don’t forget to update the firewall rules to open the port. Otherwise clients will not be able to connect to the service.
  • The final release to the public will add the ability to select the port number and autostart options for the service during installation.

Configuration

To configure the service use DYMOLabelProxyServiceConfiguration.exe utility. It lets you change the port number the service is listening to as well as stop/start/restart the service. In addition the utility displays a list of urls that might be used to connect to the service.

image

Changing Port Number

To change the port number enter a new value into “Port Number” field and click “Apply” button. Right now the service is not restarted automatically, so don’t forget to restart it.

Service Control

You can start/stop/restart the service from within the configuration utility. Alternatively standard “Services” panel of the  “Computer Management" tool can be used.

Service URIs

To be able to access the service, the service’s URI should be known on the mobile device. From a programmatic side it is done by calling a framework function addPrinterUri(); we will look at addPrinterUri() later when analyzing a sample application. But what URI to use? Well, it depends on various of factors, like network configuration, a mobile device type, etc.

Bonjour Name

If your device supports Bonjour protocol, i.e. it is a iPhone or iPad, then most likely you can use the first URI in the list, that has a form http://.local:. Here “.local” represents a default Bonjour domain. Even if Bonjour is supported on the mobile device there might be problem if your mobile device and the service are connected to different subnets, e.g. the mobile device is connected to a “wireless” subnet and the service to a “wired” subnet. It is not a problem with the DYMO service, it is how Bonjour works in default configuration. There are solutions for this problem, but the details descriptions are beyond the scope of this post. Some ideas:

DNS Name

If you have a DNS server running on your network, e.g. the PC running the service is in a domain, then most likely you can use a second URI contains just a PC name, like http://.

IP Address

As the last resort you can specify an ip-address. The configuration utility tries to apply some intelligence here and filters ip-addresses. It will show ip-address for active network interfaces only. It will filter VMWare interfaces as well. So, the URI in this case is like http://:

Changes in DYMO Label Framework JavaScript Library

The goal was to modify API in a such way, so existing web applications that use the library should not require major changes. In many cases the only change that needs to be done to an application is to call dymo.label.framework.addPrinterUri() function to “register” the proxy service’s URI, so the framework knows how to communicate with the printer. Below is a short list of changes.

Checking for the Framework Installation

Previously dymo.label.framework.checkEnvironment() function could be used for checking if the library can be used or not. E.g. it checked if the browser is one of the  supported browsers, is DYMO Label software installed or not, etc. Now, because any browser can be used and DYMO Label software is not required to be installed this function is kind of obsolete. It is still a part of the library but it will return a correct result only if running on Windows or Mac assuming you are going to use a Framework dependent parts of the library (see below).

Framework Dependent Functions

Some functions depend on a browser plugin and DYMO Label software being installed to operate. These functions access a local file system to load a label or an image file. If these functions are called when running on a mobile device  an exception will be thrown. It is a good idea to call checkEnviromnent() first to make sure the functions can be called. The functions are dymo.label.framework.openLabelFile() and dymo.label.framework.loadImageAsPngBase64().

Printer Registration

To be able to communicate with the printer , the library needs to know the DYMO Label Proxy service URI. To “register” a printer with the library, use dymo.label.framework.addPrinterUri() function. To “deregester” a printer use dymo.label.framework.removePrinterUri() function. Multiple printers/proxy services can be registered. To register a different service just call addPrinterUri() with a different URI. To deregister all printers use dymo.label.framework.removeAllPrinterUri() function.

Printing Status Checking

When printing from a desktop it might be not necessary to know the print status because the status can be easily accessed from the spooler UI. When printing from a mobile device it is not so easy. So, we added some functions for monitoring print job progress. dymo.label.framework.printLabel2() and label.print2() can be used to create a print job. An object representing a print job is returned by these calls and can be used to monitor  the job progress by calling printJob.getStatus(). There is an utility function to combine both operations into one. It is dymo.label.framework.printLabelAndPollStatus() (and the correspondent label.printAndPollStatus()). Status checking function can be called for any printer, even if the application is running on Windows and  printer is locally connected printer. Status checking for a printer locally connected to a Mac is not implemented in this BETA release.

Sample

Now the fun part Smile Let see how it works in practice. The sample is http://labelwriter.com/software/dls/sdk/samples/js/PrintMeThatLabel/pl.html. When manually typing the url, make sure to use it as-is, because it is case-sensitive. The JavaScript code for the sample is http://labelwriter.com/software/dls/sdk/samples/js/PrintMeThatLabel/PrintMeThatLabel.js

Adding Printer URI

The first thing that has to be done is to add/register printer URI. Type one of the URIs displayed in the configuration utility into the “Printer location(url) field. Make sure to use the full URI, including the protocol scheme. Then click the “Add” button. A list of printers installed on the proxy’s machine should be displayed in the printers drop down list. The click event handler for the “Add” button is as following:

addPrinterUriButton.onclick = function()
{
    try
    {
        var printerUri = printerUriTextBox.value;
        if (!printerUri)
            throw new Error("Specify printer Url");

        dymo.label.framework.addPrinterUri(printerUri, '',
            function()
            {
                settings.printerUris.push(printerUri);
                saveSettings();
                updatePrinters();
            },
            function()
            {
                alert('Unable to connect to "' + printerUri + '"');
            }
        );

    }
    catch(e)
    {
        alert(e.message || e);
    }
}


It checks that something is entered into printer URI field and then calls dymo.label.framework.addPrinterUri() function that does the main job. The signature for addPrinterUri() is

/**
    @param {string} printerUri
    @param {string=} opt_location
    @param {Function=} opt_successCallback
    @param {Function=} opt_errorCallback

    @return {undefined}
*/
dymo.label.framework.addPrinterUri = function(printerUri, opt_location, opt_successCallback, opt_errorCallback)

addPrinterUri() accepts four parameters:

  • printerUri – string URI of the proxy service. It is a required parameter
  • opt_location – optional string representing the printer location. A value passed in this parameter will be used as a part of printer name. If nothing is passed, then the host part of the URI will be used as the location.
  • opt_successCallback – optional callback function called when the service has returned information about available printers. One parameter is passed to the callback – the printerUri of the service.
  • opt_errorCallback – optional callback called when the service cannot be contacted, e.g. the service is down, or the printerURI is invalid. One parameter is passed to the callback – the printerUri of the service.

When addPrinterUri() is called it remembers the printerUri in an internal structures and tries to make a request to the proxy service to obtain information about available printers – model name, printer name, printer type, etc. This request is made asynchronously, so addPrinterUri() returns almost immediately, and callbacks, if provided, are called later when the request is completed. You know, the usual Ajax stuff Smile

For the sample, the printerUri parameter is taken from the printer url field. The opt_location is an empty string, so the host part of the uri will be used as a location. opt_errorCallback displays a simple message box telling the user about connection problem. opt_successCallback remembers the uri, so next time you opens the sample there is no need to reenter the uri (see below for more discussion). After that a printers drop down list is updated by updatePrinters().

function updatePrinters()
{
    // clear first
    removeChildren(printersComboBox);

    printers = dymo.label.framework.getPrinters();

    for (var i = 0; i < printers.length; i++)
    {
        var printerName = printers[i].name;

        // add combo box item
        var option = document.createElement('option');
        option.value = printerName;
        option.appendChild(document.createTextNode(printerName));
        printersComboBox.appendChild(option);

        // select current printer
        if (printerName == settings.currentPrinterName)
            printersComboBox.selectedIndex = i;
    }

    // hide 'add printer url' controls if there are printers to use
    printerSettingsDiv.style.display= printers.length == 0 ? 'block' : 'none';
};


The main item here is a call to dymo.label.framework.getPrinters(). getPrinters() is a synchronous call that uses “cached” printer information returned by the proxy service. Because it is called from a opt_successCallback we are sure that information is really available. It would be a mistake to call  dymo.label.framework.getPrinters() right after dymo.label.framework.addPrinterUri() like this

// Don't do that, will not work
dymo.label.framework.addPrinterUri('http://myservice:8631');
var printers = dymo.label.framework.getPrinters();
// process printers...

In this case the ‘printers’ variable most likely will contain an empty array (or array with local printers only).

Multiple proxy services can be added/registers at the same time. Just type a new service uri and click “Add” button.

To remove/unregester all proxy services, click on “Clear” button

clearPrinterUriButton.onclick = function()
{
    dymo.label.framework.removeAllPrinterUri();
    settings.printerUris = [];
    saveSettings();
    updatePrinters();
}

dymo.label.framework.removeAllPrinterUri() does the main job and the rest updates the UI.

If you want to unregister one proxy service you can call dymo.label.framework.removePrinterUri() with the service uri as a parameter.

/**
    @param {string} printerUri 
    @return {undefined}
*/
dymo.label.framework.removePrinterUri = function(printerUri)

Settings

An utility Settings class is used to store proxy Uris and the last used printer between sessions. In this sample, cookies are used as a persistent storage. In a real application other more reliable mechanisms should be used instead.

// app settings stored between sessions
var Settings = function()
{
    this.currentPrinterName = "";
    this.printerUris = [];
}

// loads settings
Settings.prototype.load = function()
{
    var currentPrinterName = Cookie.get('currentPrinterName');
    var printerUris = Cookie.get('printerUris');

    if (currentPrinterName)
        this.currentPrinterName = currentPrinterName;

    if (printerUris)
        this.printerUris = printerUris.split('|');
}

Settings.prototype.save = function()
{
    Cookie.set('currentPrinterName', this.currentPrinterName, 24*365);
    Cookie.set('printerUris', this.printerUris.join('|'), 24*365);
}

Loading Labels

DYMO Web SDK supports printing on both die-cut labels and tape labels. Label files for these two labels type are similar but different. So, the sample needs two label files for printing depending upon what printer is selected.

// load labels from the server
function loadLabels()
{
    $.get("Address.label", function(labelXml)
    {
        addressLabel = dymo.label.framework.openLabelXml(labelXml);
    }, "text");

    $.get("12mm.label", function(labelXml)
    {
        tapeLabel = dymo.label.framework.openLabelXml(labelXml);
    }, "text");
}

Labels are fetched from files “Address.label” and “12mm.label”. This  files are located on the server in the same folder as other files for the sample. The files are loaded using jQuery’s get() method. After label files are loaded, they are “opened” by using  dymo.label.framework.openLabelXml() function; the resulting “label” objects are stored in addressLabel variable and tapeLabel variable.

Printing and Status Checking

Type some data into the label text box and click “Print” button. The following is the function that does printing. It is a little bit long, but we will look at it part by part.

printButton.onclick = function()
{
    try
    {
        printButton.disabled = true;

        settings.currentPrinterName = printersComboBox.value;

        var text = document.getElementById('labelTextArea').value;

        var printer = printers[settings.currentPrinterName];
        if (!printer)
            throw new Error("Select printer");

        // determine what label to print based on printer type
        var label = null;
        var objName = "";
        if (printer.printerType == "LabelWriterPrinter")
        {
            label = addressLabel;
            objName = "Address";
        }
        else
        {
            label = tapeLabel;
            objName = "Text";
        }

        if (!label)
            throw new Error("Label is not loaded. Wait until is loaded or reload the page");

        // set data
        var labelSet = new dymo.label.framework.LabelSetBuilder();
        labelSet.addRecord().setText(objName, text);

        // print and get status
        var printJob = label.printAndPollStatus(printer.name, null, labelSet.toString(), function(printJob,
        printJobStatus)
        {
            // output status
            var statusStr = 'Job Status: ' + printJobStatus.statusMessage;

            var result = (printJobStatus.status != dymo.label.framework.PrintJobStatus.ProcessingError
                && printJobStatus.status != dymo.label.framework.PrintJobStatus.Finished);

            // reenable when the job is done (either success or fail)
            printButton.disabled = result;

            setTextContent(jobStatusMessageSpan, statusStr);

            return result;

        }, 1000);

        saveSettings();
    }
    catch(e)
    {
        printButton.disabled = false;
        alert(e.message || e);
    }
}

First, the Print button is disabled during printing, just to make things easier. The printer name and text to print is taken from UI elements and saved in printer and text variables correspondingly. If no printer is selected, e.g. no proxy uri has been added, a error saying “Select printer” is displayed.

Depending on the selected printer type a label to print is selected. Also a label object to put data into is selected.

// determine what label to print based on printer type
var label = null;
var objName = "";
if (printer.printerType == "LabelWriterPrinter")
{
    label = addressLabel;
    objName = "Address";
}
else
{
    label = tapeLabel;
    objName = "Text";
}


Then data to be printed is put into a label set object. Usually label sets are used to print multiple labels, but it is perfectly fine to use them to print a single label as well.  In this case the same objects are used regardless of number of labels printed, so the code is easier to adjust.

// set data
var labelSet = new dymo.label.framework.LabelSetBuilder();
labelSet.addRecord().setText(objName, text);


And finally the actual printing

// print and get status
var printJob = label.printAndPollStatus(printer.name, null, labelSet.toString(), function(printJob, printJobStatus)
{
    // output status
    var statusStr = 'Job Status: ' + printJobStatus.statusMessage;

    var result = (printJobStatus.status != dymo.label.framework.PrintJobStatus.ProcessingError
        && printJobStatus.status != dymo.label.framework.PrintJobStatus.Finished);

    // reenable when the job is done (either success or fail)
    printButton.disabled = result;

    setTextContent(jobStatusMessageSpan, statusStr);

    return result;

}, 1000);


The  job is done by the printAndPollStatus() method. This method sends a label and label data to be printed to the selected proxy service, and then periodically checks for the print job status. When a status is available a callback is called with new status information, so the application code can update the UI. printAndPollstatus() has following signature:

/** Prints a label and runs status checking in a loop

    @param {string} printerName
    @param {string} printParamsXml
    @param {string} labelSetXml 
    @param {function(PrintJob, PrintJobStatusInfo): boolean} statusCallback
    @param {number} pollInterval 
    @return {PrintJob}
*/
printAndPollStatus = function(printerName, printParamsXml, labelSetXml, statusCallback, pollInterval)

‘printerName’ is the name of the printer to print on. Usually obtained by calling dymo.label.framework.getPrinters(). printParamsXml – printing parameters, in our case we pass null, so default parameters are used. ‘labelSetXml’ – label data to print. ‘pollInterval’ – interval in milliseconds to ask the proxy service for the job status information. In our case we use an one second interval. ‘statusCallback’ – status callback function called when the service returned status information. the callback takes two parameters; the first is PrintJob object. It can be used to get the status information on demand, without using polling. Also, it might be extended in the future to provide more control over the print job, e.g. an ability to cancel it. The second parameter to the callback is PrintJobStatusInfo class. PrintJobStatusInfo has two properties: statusMessage that contains a status message string; and status that contains status code. The callback has to return a boolean value. If true is returned, than pritnAndPollStatus() will poll the serivce again after the pollInterval passed. If false is returned, then printAndPollStatus() finishes processing. printandPollstatus() returns PrintJob object for the created print job. It has a little of use right now, but may be useful in the future if PrintJob is extended to support more operations.

So, in our sample the callback does the following:

  • a string representing the printing status is assembled by using ‘Job status:’ prefix followed by real status string obtained from statusMessage property.
  • determine if we should continue polling the service for the status or not. We stop polling the service when the status is either dymo.label.framework.PrintJobStatus.ProcessingError, that means something really bad happened and print job has not been even created (e.g. the label has an invalid format, or Windows spooler is not running , or DYMO Label is not installed correctly); or the status is dymo.label.framework.PrintJobStatus.Finished, that means the print job is completed.
  • If no more polling is going to be done, then the “Print” button is enabled again, so another label can be printed
  • and finally the UI is updated to display the status string

The library provides different functions to do printing and status checking. For printing use print2() method of Label object. It has the same parameters as the print() method and returns a PrintJob object. The PrintJob object then can be used to get the status by calling getStatus() method, which has following signature:

/** 
    Gets a status of the print job
    @param {function(PrintJobStatusInfo)} replyCallback a function called when the status is available
    @return {undefined}
*/
getStatus = function(replyCallback)

In addition to Label class methods, similar functions are defined in dymo.label.framework namespace.

One similar to label.print2()

/** Prints a label and returns a print job object

    @param {string} printerName the printer to print on. A list of printers can be obtained by getPrinters()
    @param {string} printParamsXml printing parameters, like number of copies, print quality, etc. See PrintParams.xsd
    @param {string} labelXml label to print
    @param {string} labelSetXml 
        LabelSet to print. LabelSet is used to print multiple labels with same layout but different data, e.g. multiple 
        addresses. 
        Use LabelSetBuilder to create a LabelSet or construct xml manualy according to LabelSet.xsd
    @return {dymo.label.framework.PrintJob} print job
*/
dymo.label.framework.printLabel2 = function(printerName, printParamsXml, labelXml, labelSetXml)


Another, similar to label.printAndPollStatus()

/** Prints a label and runs status checking in a loop

    @param {string} printerName the printer to print on. A list of printers can be obtained by getPrinters()
    @param {string} printParamsXml printing parameters, like number of copies, print quality, etc. See PrintParams.xsd
    @param {string} labelXml label to print
    @param {string} labelSetXml 
        LabelSet to print. LabelSet is used to print multiple labels with same layout but different data, e.g. multiple 
        addresses. 
        Use LabelSetBuilder to create a LabelSet or construct xml manualy according to LabelSet.xsd
    @param {function(PrintJob, PrintJobStatusInfo): boolean} statusCallback
        Function to be called when a print job status is available.
        To continue polling the status the function should return true, false otherwise 
    @param {number} pollInterval poll interval in milliseconds
    @return {dymo.label.framework.PrintJob}
*/
dymo.label.framework.printLabelAndPollStatus = function(printerName, printParamsXml, labelXml, labelSetXml,
statusCallback, pollInterval)

Conclusion

We are really exited about the Web SDK and hope you can find it useful. Any thoughts, feedback, critics are welcome Smile

  66 Responses to “DYMO Label Web SDK (BETA)”

  1. hey his is great i was look for something like this a bit back. the way i tried to do it was by running a bat file to print the lable from php.

    this is very good though will help also any chance of some sample files for example where you type the text and click print.
    i mean i will prob be able to get it to work though others may struggle?

    just a fort.

  2. Is there a way to use this to print pdf 417 labels? I copied the .label file I use with the printing software, but it doesn’t print the pdf417 code, just something really tiny and unintelligible.

    • Experimental support for PDF417 (as well as for QRCode) has been added in DYMO Label 8.3. You will have to edit a label file manually, because there is no UI support yet. Just create a label in DYMO Label, save it into a file, open a file in your preferred xml editor; locate barcode type element (XPath is like /DieCutLabel/ObjectInfo/BarcodeObject/Type); enter “Pdf417” for the Type inner text. Now you can load this label using DYMO Label Framework JavaScript Library and set the barcode content as for any other barcode type, e.g. using label.setObjectText() or record.setText().

      If this does not help, please provide your label file as well as the barcode data you are trying to print. You can e-mail it to vbuzuev a dymo d o t com

  3. wonderfull tool! I see a lot of possibilities. But i have a question, in wich way i can support multiple label formats? Should I edit the Address.label.js and change here the settings or can i put differntlabel formats in these file?

    • Thanks,

      Could you please be more specific, what did you mean by “multiple label formats”? what is the use case, what you are trying to archive? Are you going to print labels with different “objects”, e.g. a one label with a text, and another with a photo? Or the label objects are the same, but you want different data and or data formatting, e.g. different font sizes and styles?

    • Found the solution!
      I can create the Address.label file in the labelmanager software and save the definition and place it one the webserver. Now can use the definition with other label formats and margins.

      I was thought that I must edit the address.label file by myself.

      But now the major question, can there multiple label formats in the address.label file and then, before press PRINT, to select which labeldefinition I want use.

      (I wrote this during Vlamadir his response…)

      • Each label file can contain only one “format”/”layout”. But you can download several formats from the web server and choose one you want on the fly based on your application needs. E.g. in the sample above, there are two files “Address.label” and “12mm.label”; one to print is selected in print button handler, see printButton.onclick, based on currently selected printer type.

  4. I am having trouble printing getting this example to print to a shared printer connected to another computer via USB.

    I’ve tried a few different versions of OS X with various versions of firefox, safari, and chrome. I was able to get a label to print using safari 5.05 with OS X 10.6. I have the dymo label software 8.3 installed on each computer and the printer installed and am able to print through the label software no problem. Are there any additional steps I need to do to get the above example to work?

    • Here is the example I referred to above, link markup got mangled or something.

      http://labelwriter.com/software/dls/sdk/samples/js/PrintMeThatLabel/pl.html

      • This sample will not print to a printer installed locally (or shared) from MacOSX. The reason, we had no time to update DLS on Mac to add support for printing status information. To make it work on Mac you will have to uncomment the call to label.print() in PrintMeThatLabel.js and comment out label.printAndPollStatus()

        // print
        label.print(printer.name, null, labelSet.toString());
        // print and get status
        //var printJob = label.printAndPollStatus(printer.name, null, labelSet.toString(), function(printJob, printJobStatus)
        //…

        As is, the sample will print through DYMO Label Proxy service to a printer installed on Windows as described in the post.

        • I tried the example using the print call instead of printAndPollStatus, this is what I was actually using in my own code. It seems to be a problem with getPrinters that I am having since the select box is empty, getPrinters is returning null. Any ideas why this might be happening?

  5. Hi all… I would like to preview a labelset (variable set) using one label. It’s possible?

    Thanks in advane.

  6. Awesome stuff. Is there a way we can have the user select “3” from a dropdown and the printer will print 3 labels instead of just 1?

  7. The Label Proxy is a great approach. I’m not able to get it to work however since it won’t run on Mac OS X.
    I’ve got Mac OS X 10.6.7 and a locally connected LabelWriter 450 with DLS 8.3.0.1413 installed.

    1) When do you expect to support the DYMO Label Proxy on Mac?

    2) When I try the sample at “http://labelwriter.com/software/dls/sdk/samples/js/PrintMeThatLabel/pl.html” in Safari 5.0.5
    I can print to my local 450, without using the printer uri (since I can’t run the proxy). But when I try the same example
    using firefox 4.0.1 I get:

    This page requires a plug-in that can only run in 32-bit mode (Restart in 32-bit Mode)

    Is there a 64-bit version of the DYMO Label Plug-in 1.0 that DLS installed?

    Thanks,
    –Jim

    • The Proxy service for Mac is under development, but there is no exact release date yet. Firefox 64-bit plugin will be released as a part of DLS 8.4 later this year.

  8. Will this work with IE9? When I try to print, I get the error “Object doesn’t support property or method ‘PrintLabel2′”.

  9. Are there any example of printing a lable on page load and populating the text with php?

    EXAMPLE
    ——————————–
    When my page loads it prints a lable. The text printed is the text from my varable $lable etc

    Thanks alot :D

    p.s
    I am useing LableWriter 450 Turbo (this will not change!)

  10. This looks excellent. When will it be to of beta?

  11. This web SDK looks great, but I am having trouble getting it working. Using the demo ( http://labelwriter.com/software/dls/sdk/samples/js/PrintMeThatLabel/pl.html) I can see my printer okay, but when I try to print the test label I get “Job Status: InvalidJobId”.

    Any idea what could be causing this?

    • After a bit of digging, the GET request to initiate the printing is aborting, however, as mentioned on another thread (http://developers.dymo.com/2011/05/25/poll-what-platforms-would-you-like-to-dymo-label-sdk-to-support/) I am able to POST to http://192.168.0.8:8631/printLabel and can get a test label to print that way.

      Here’s the GET which is failing:

      http://192.168.0.8:8631/pl?j=825BBE48-0702-45DC-B737-8977B51E9663&cid=0&pl=%7B%22printerName%22%3A%22DYMO%20LabelWriter%20450%22%2C%22labelXml%22%3A%22%3C%3Fxml%20version%3D%5C%221.0%5C%22%20encoding%3D%5C%22UTF-8%5C%22%3F%3E%5Cn%3CDieCutLabel%20Version%3D%5C%228.0%5C%22%20Units%3D%5C%22twips%5C%22%3E%5Cn%20%20%20%20%3CPaperOrientation%3ELandscape%3C%2FPaperOrientation%3E%5Cn%20%20%20%20%3CId%3EAddress%3C%2FId%3E%5Cn%20%20%20%20%3CPaperName%3E30252%20Address%3C%2FPaperName%3E%5Cn%20%20%20%20%3CDrawCommands%3E%5Cn%20%20%20%20%20%20%20%20%3CRoundRectangle%20X%3D%5C%220%5C%22%20Y%3D%5C%220%5C%22%20Width%3D%5C%221581%5C%22%20Height%3D%5C%225040%5C%22%20Rx%3D%5C%22270%5C%22%20Ry%3D%5C%22270%5C%22%2F%3E%5Cn%20%20%20%20%3C%2FDrawCommands%3E%5Cn%20%20%20%20%3CObjectInfo%3E%5Cn%20%20%20%20%20%20%20%20%3CAddressObject%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CName%3EAddress%3C%2FName%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CForeColor%20Alpha%3D%5C%22255%5C%22%20Red%3D%5C%220%5C%22%20Green%3D%5C%220%5C%22%20Blue%3D%5C%220%5C%22%2F%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CBackColor%20Alpha%3D%5C%220%5C%22%20Red%3D%5C%22255%5C%22%20Green%3D%5C%22255%5C%22%20Blue%3D%5C%22255%5C%22%2F%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CLinkedObjectName%2F%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CRotation%3ERotation0%3C%2FRotation%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CIsMirrored%3EFalse%3C%2FIsMirrored%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CIsVariable%3ETrue%3C%2FIsVariable%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CHorizontalAlignment%3ELeft%3C%2FHorizontalAlignment%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CVerticalAlignment%3EMiddle%3C%2FVerticalAlignment%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CTextFitMode%3EShrinkToFit%3C%2FTextFitMode%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CUseFullFontHeight%3ETrue%3C%2FUseFullFontHeight%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CVerticalized%3EFalse%3C%2FVerticalized%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CStyledText%2F%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CShowBarcodeFor9DigitZipOnly%3EFalse%3C%2FShowBarcodeFor9DigitZipOnly%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CBarcodePosition%3EBelowAddress%3C%2FBarcodePosition%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CLineFonts%2F%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FAddressObject%3E%5Cn%20%20%20%20%20%20%20%20%3CBounds%20X%3D%5C%22332%5C%22%20Y%3D%5C%22150%5C%22%20Width%3D%5C%224455%5C%22%20Height%3D%5C%221260%5C%22%2F%3E%5Cn%20%20%20%20%3C%2FObjectInfo%3E%5Cn%3C%2FDieCutLabel%3E%22%2C%22printParamsXml%22%3A%22%22%2C%22labelSetXml%22%3A%22%3CLabelSet%3E%3CLabelRecord%3E%3CObjectData%20Name%3D%5C%22Address%5C%22%3Etest%3C%2FObjectData%3E%3C%2FLabelRecord%3E%3C%2FLabelSet%3E%22%7D&c=_callbacks_._1h0ky0160

  12. Hi there, I’m getting an error ‘Invalid JobId’ when I try to print using the test page. I can add the printer fine using the url and it loads it with the correct model number so it must be accessing fine there. Then I enter text and hit print ad get the JobId error, any ideas anyone?

  13. I cannot see a list of supported devices anywhere. Is that because all dymo label printers are support or? Reason why I’m asking is because Im trying to get this to work with a 450 duo which absolutely no luck.

  14. I am trying to print, with proxy service and see the printers, but the javascript console shows error in GET method (FAILED). invalidjobid. help please and example.

  15. Hi there, read the post above about the problems with the jobid being invalid. I might be stupid but what was the solution. I tried everything described above and nothing seems to be working…
    also do I only get a timeout for the call “http://192.168.1.3:8631/printLabel”. Firewall is disabled and no anti virus running. Please see below the POST from the ” http://labelwriter.com/software/dls/sdk/samples/js/PrintMeThatLabel/pl.html” running on my local server. Haven’t changed anything in this file or the “http://labelwriter.com/software/dls/sdk/samples/js/PrintMeThatLabel/PrintMeThatLabel.js”.
    I also copied all the other files from the server (jquery-1.4.3.min.js | cookie.js | base64.js) just to be sure.

    http://192.168.1.3:8631/pl?j=ED212FD3-F935-4C2F-B88E-0A20F97998C1&cid=0&pl=%7B%22printerName%22%3A%22DYMO%20LabelWriter%20450%22%2C%22labelXml%22%3A%22%3C%3Fxml%20version%3D%5C%221.0%5C%22%20encoding%3D%5C%22utf-8%5C%22%3F%3E%3CDieCutLabel%20Version%3D%5C%228.0%5C%22%20Units%3D%5C%22twips%5C%22%3E%5Cn%5Ct%3CPaperOrientation%3ELandscape%3C%2FPaperOrientation%3E%5Cn%5Ct%3CId%3EAddress%3C%2FId%3E%5Cn%5Ct%3CPaperName%3E30252%20Address%3C%2FPaperName%3E%5Cn%5Ct%3CDrawCommands%3E%5Cn%5Ct%5Ct%3CRoundRectangle%20X%3D%5C%220%5C%22%20Y%3D%5C%220%5C%22%20Width%3D%5C%221581%5C%22%20Height%3D%5C%225040%5C%22%20Rx%3D%5C%22270%5C%22%20Ry%3D%5C%22270%5C%22%2F%3E%5Cn%5Ct%3C%2FDrawCommands%3E%5Cn%5Ct%3CObjectInfo%3E%5Cn%5Ct%5Ct%3CAddressObject%3E%5Cn%5Ct%5Ct%5Ct%3CName%3EAddress%3C%2FName%3E%5Cn%5Ct%5Ct%5Ct%3CForeColor%20Alpha%3D%5C%22255%5C%22%20Red%3D%5C%220%5C%22%20Green%3D%5C%220%5C%22%20Blue%3D%5C%220%5C%22%2F%3E%5Cn%5Ct%5Ct%5Ct%3CBackColor%20Alpha%3D%5C%220%5C%22%20Red%3D%5C%22255%5C%22%20Green%3D%5C%22255%5C%22%20Blue%3D%5C%22255%5C%22%2F%3E%5Cn%5Ct%5Ct%5Ct%3CLinkedObjectName%2F%3E%5Cn%5Ct%5Ct%5Ct%3CRotation%3ERotation0%3C%2FRotation%3E%5Cn%5Ct%5Ct%5Ct%3CIsMirrored%3EFalse%3C%2FIsMirrored%3E%5Cn%5Ct%5Ct%5Ct%3CIsVariable%3ETrue%3C%2FIsVariable%3E%5Cn%5Ct%5Ct%5Ct%3CHorizontalAlignment%3ELeft%3C%2FHorizontalAlignment%3E%5Cn%5Ct%5Ct%5Ct%3CVerticalAlignment%3EMiddle%3C%2FVerticalAlignment%3E%5Cn%5Ct%5Ct%5Ct%3CTextFitMode%3EShrinkToFit%3C%2FTextFitMode%3E%5Cn%5Ct%5Ct%5Ct%3CUseFullFontHeight%3ETrue%3C%2FUseFullFontHeight%3E%5Cn%5Ct%5Ct%5Ct%3CVerticalized%3EFalse%3C%2FVerticalized%3E%5Cn%5Ct%5Ct%5Ct%3CStyledText%3E%5Cn%5Ct%5Ct%5Ct%5Ct%3CElement%3E%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%3CString%3EClick%20here%20to%20enter%20address%3C%2FString%3E%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%3CAttributes%3E%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%3CFont%20Family%3D%5C%22Arial%5C%22%20Size%3D%5C%2212%5C%22%20Bold%3D%5C%22False%5C%22%20Italic%3D%5C%22False%5C%22%20Underline%3D%5C%22False%5C%22%20Strikeout%3D%5C%22False%5C%22%2F%3E%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%3CForeColor%20Alpha%3D%5C%22255%5C%22%20Red%3D%5C%220%5C%22%20Green%3D%5C%220%5C%22%20Blue%3D%5C%220%5C%22%2F%3E%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%3C%2FAttributes%3E%5Cn%5Ct%5Ct%5Ct%5Ct%3C%2FElement%3E%5Cn%5Ct%5Ct%5Ct%3C%2FStyledText%3E%5Cn%5Ct%5Ct%5Ct%3CShowBarcodeFor9DigitZipOnly%3EFalse%3C%2FShowBarcodeFor9DigitZipOnly%3E%5Cn%5Ct%5Ct%5Ct%3CBarcodePosition%3ESuppress%3C%2FBarcodePosition%3E%5Cn%5Ct%5Ct%5Ct%3CLineFonts%3E%5Cn%5Ct%5Ct%5Ct%5Ct%3CFont%20Family%3D%5C%22Arial%5C%22%20Size%3D%5C%2212%5C%22%20Bold%3D%5C%22False%5C%22%20Italic%3D%5C%22False%5C%22%20Underline%3D%5C%22False%5C%22%20Strikeout%3D%5C%22False%5C%22%2F%3E%5Cn%5Ct%5Ct%5Ct%3C%2FLineFonts%3E%5Cn%5Ct%5Ct%3C%2FAddressObject%3E%5Cn%5Ct%5Ct%3CBounds%20X%3D%5C%22332%5C%22%20Y%3D%5C%22150%5C%22%20Width%3D%5C%224455%5C%22%20Height%3D%5C%221260%5C%22%2F%3E%5Cn%5Ct%3C%2FObjectInfo%3E%5Cn%3C%2FDieCutLabel%3E%22%2C%22printParamsXml%22%3A%22%22%2C%22labelSetXml%22%3A%22%3CLabelSet%3E%3CLabelRecord%3E%3CObjectData%20Name%3D%5C%22Address%5C%22%3Edfsdf%3C%2FObjectData%3E%3C%2FLabelRecord%3E%3C%2FLabelSet%3E%22%7D&c=_callbacks_._1fh9vtxnq7

    Here the same just a bit nicer presented [thanks to Google Chrome]:
    j:ED212FD3-F935-4C2F-B88E-0A20F97998C1
    cid:0
    pl:{“printerName”:”DYMO LabelWriter 450″,”labelXml”:”ntLandscapentAddressnt30252 AddressntnttntntnttntttAddressntttntttntttntttRotation0ntttFalsentttTruentttLeftntttMiddlentttShrinkToFitntttTruentttFalsentttnttttntttttClick here to enter addressntttttnttttttnttttttntttttnttttntttntttFalsentttSuppressntttnttttntttnttnttntn”,”printParamsXml”:””,”labelSetXml”:”dfsdf”}
    c:_callbacks_._1fh9vtxnq7

    The funny thing is when I run the file on the local machine and the combobox shows up the local printer, the whole thing works no problem. But as soon as I change to a distant machine it is not working anymore… It also doesn’t matter it I use Firefox or Chrome.

    Is there any way to have an influence on the jobID? To select a correct one and stick to it… What is the problem with an invalid JobID? Why doesn’t the print not succeed if only an ID is wrong but the rest of the request is correct?

    Thanks for your help
    George

  16. Hi there,
    my dymo printer 450 connected to a windows7 pc works fine with the demo-page http://labelwriter.com/software/dls/sdk/samples/js/PrintMeThatLabel/pl.html . I also can connect to the proxy by entering the uri via my iPad when I turn off the firewall. But when I try to print something I get the known error about the invalidJobID.
    Is there anybody out there who is able to print with the iPad on a Dymo 450?
    Is the problem on the iPad or on the Windows-PC?
    Thanks
    Simon

    • I’m having the same issue with one of our customers (we are utilizing the iOS SDK.) We are successfully able to print when the device is shared from WinXP or Vista, however the Win7 share fails with “Unable to connect http://device.local:8631“. Browser printing DID work for the customer from his Mac to the device shared on the Win7 via our JS implementation. (didn’t try with that link)

      Using the link you shared, I get the same error. However, I am successfully able to print via our JS implementation but are sharing from a WinXP.) Have you tried making sure the ProxyService is allowed through the Firewall? Maybe the Bonjour service as well?

  17. What is the status of this API? Is it still in Beta? Is development continuing, or has it been abandoned?

    The concept seems to be a very good fit for what I am looking for, but I am nervous. If it has been stagnant for 2 years…

    • Never mind… I just got to the part about configuring inbound firewall ports. Now that is something I don’t want to have to walk my end-users through.

      So I guess there are really maybe 3 options available for integrating with my website

      1) JavaScript API that uses ActiveX
      2) Silverlight application? Has anyone tried that? Is it intuitive for users to give it elevated permissions?
      3) Click Once application that can pull the address list via SOAP (right now seems like the best option)

      I am not a big fan of ActiveX, but it is the only option I have seen that has a sample that includes a preview of the layout. Is the preview not possible with the new .Net Framework samples?

      • Rob,

        On ILabel, there is a method named RenderAsPng() which you could use to display a preview of your label.

    • Hi Rob,

      This API is still in BETA stage. There are no current plans to bring it out of BETA.

  18. It’s been a year since the last post. Will this ever leave beta?

  19. how do I remove the DYMO Label Web Service from my (MAC os.X ) i do not want the notification or icon to appear on my status bar. I’ve tried to remove and delete it but cannot find the right files to do so.

    • You can uninstall the Web Service by going to Mac HD > Library > Frameworks > DYMO > SDK, and trashing the DYMO.DLS.Printing.Host.app.

      Another way to do it would be to uninstall and reinstall, and make certain not to select the option to install the web service.

  20. Hello DYMO,
    Is it possible to print DYMO 450 Turbo labels from an iPad/iPhone or Android tablet/phone ?
    Would appreciate the steps.
    Also, is the DYMO required to be connected to a laptop/desktop for that, or can the iPad directly print to it over the wireless network?
    Many thanks,
    Rajat

  21. Do we have latest sdk for ios 12.

  22. Hi, I’m hoping somebody/something still monitors this post. It doesn’t look like this was brought out of beta.

    If it’s not out of beta, is there any other way to monitor the print jobs (number of labels printed), using the DYMO JavaScript library? I tried the printAndPollStatus and print2 functions, but they didn’t seem to actually be monitoring the printer status correctly.

    Any thoughts?

    Regards,
    Chris

Leave a Reply to Ross Cancel 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)