Jan 052016
 

I hope everyone enjoyed their holidays!  We have had a number of issues reported, several of them were big enough that we decided to release an 8.5.3 patch version that fixes the issues that were found.

Issues Fixed:

  • Win: There were instances that caused Barcode corruption when the Barcode was rotated on a label
  • Mac: There were issues with with the Web Service refreshing the list of DYMO printers
  • Mac: Web Service method timeout is increased due to too many timeouts
  • JS: Fixed issues with Async calls
  • JS: Fixed Issue that isBroswerSupported return the wrong value
  • JS: Fix Issue with a Crash when running in IE8

Reference the following posts for additional set up information.  Keep in mind that the Web Service is built into this version of DYMO Label so the standalone install is no longer required.

Downloads:

Thanks for all the great feedback!  Let us know of any issues found, we’ll continue to give the best support we can.

Update: Fixed a typo that was referencing the wrong revision number for the Windows build

Dec 142015
 

We are proud to announce the release of DYMO Label software version 8.5.3 for Mac.

UPDATE: The newest version is available in the following post: DLS 8.5.3 Patch Release

This release includes:

  • Support for OS X El Capitan
  • Support for Microsoft Office 2016
  • DYMO Label Web Service is installed for use by the DYMO Label Framework.

You can now download: DYMO Label software 8.5.3
You can also download the JavaScript Library : DYMO Label Framework 2.0

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:

  1. Click on the DYMO icon in the upper right on the top menu bar
  2. Select Diagnose
  3. If a dialog pops up and it complains about no ssl assigned to the port, you should reboot.
  4. If you see a dialog that says “DYMO Label Web Service is running on port XXX”, then there could be a different issue.

 

 

Sep 242015
 

We apologize for the length of the delay in this release but we ran into a number of unforeseen issues trying to fix a couple of the bigger issues that were brought to our attention. The two issues that we are addressing in this release are problems with HTTPS and Network Printer discovery.

Requirements

Network Printers

This was a big issue. A service running on windows will not see Network/shared printers for a user and there are Microsoft bugs that prevent seeing these printers when the service is run as the current user. With that in mind, we had to re-implement the way the service is run. It is now a service that starts when the user logs in. This Service will appear in a user’s application tray and can be configured from there. This will allow the SDK to see any Network/Shared Printers that the user has installed.

HTTPS

Our JavaScript library now connects to the web service via HTTPS. We have to install a self-signed certificate to allow this to happen. After installation finishes, we will ask the user if they want to open up the default browser to accept the certificate. Once the certificate is accepted then all HTTPS traffic should work as normal. You can install the certificate on other browsers by going to “https://localhost:/DYMO/DLS/Printing/Check”. This is important for the Firefox browser.

New Tray application

The new tray tool has several options:

  • Start/Stop the Service
  • Configure: Which will let you specifically configure a port within the approved range.
  • Diagnose: This will confirm that the service is running and identify the port.

Notes

  • The KB2954953 patch no longers needs to be applied for the service to work
  • We’ve seen some issues where the service needs to run with elevated permissions to see the printers. We are working on this issue.
  • We’ve seen some crashes when the service starts or at the end of the install. We are investigating but you should be able to start the service from the C:\Program Files (x86)\DYMO\DLS Web Service\DYMO.DLS.Printing.Host.exe
  • The Mac version is being tested right now and we hope to have a version released soon.

We appreciate your patience! We are working on this as hard as we can and understand your frustrations with delays. We want to insure that we release a quality product that can meet your demands. Your feedback is valuable to us!

Aug 202015
 

We are proud to announce the Open Beta of the new DYMO Label Framework JavaScript Library 2.0. This solution uses a new communication mechanism that will work on all browsers. This means that we have removed the dependency of browser specific plugins like NPAPI and Active-X. The current DYMO Label Framework API is fully supported.

Requirements

The new init method

Since the new communication protocol needs to discover the port that the DYMO service is listening on, a new method was introduced, dymo.label.framework.init(callback). This method performs a scan of a range of ports to look for the DYMO service. This method needs to finish before any other DYMO Framework API calls are made. To accomplish this, the method takes a callback method that will be called as soon as the dymo.label.framework.init method finishes.

Backward Compatibility Mode

If the dymo.label.framework.init method is not called (i.e. no user code has been changed) then the Framework goes into backward compatibility mode. It will try to scan the first port in the defined range and if it finds the service, the new communication protocol will be used. If it fails, it will fall back to the previous implementation that uses native plugins (NPAPI/Active-X).

Init Example

Typical startup code where a method is subscribed to an onload event:

function startupCode() {
    /* access DYMO Label Framework Library */
}
window.onload = startupCode;

The code should be changed to call a shim that will initialize the DYMO Framework before calling the rest of the startup code.

function startupCode() {
    /* access DYMO Label Framework Library */
}
function frameworkInitShim() {
    dymo.label.framework.init(startupCode); //init, then invoke a callback
}
window.onload = frameworkInitShim;

Tracing

We have added a new tracing feature. This can be used to help debug issues with the new service. The property is called dymo.label.framework.trace. When set to true, it will put tracing messages in the browser developer console. You should set the trace property before calling the dymo.label.framework.init method:

Tracing Example

dymo.label.framework.trace = 1; //true
dymo.label.framework.init(startupCode);

Known Limitations

  • The port number that the service binds to is not user definable. We tried to use a range of ports that are not typically used but there could be port conflicts.
  • HTTPS: Because the service currently uses insecure (http) requests, some browsers may have some issues. For example, Firefox will block insecure XHR requests when a page is loaded through HTTPS. So in order to enable it, the user has to click icon in the address bar and enable insecure requests within a secure connection.
  • As stated in the requirements, a Microsoft patch is typically required on Windows 8 and greater.
  • MacOSX support is not included in this Beta, we are working on it now and we will post more news about this version soon.
  • As with DLS, we do not support Windows Server configurations.

To Do

  • A new version of the DYMO Label Software 8.5.2 will become available. This version will include the new Framework implementation and will be considered the Release version of the new Framework. This is expected to be released near the end of September.
  • Service Configuration (Port Number): Currently, the service will bind to the first available port within a given range. We will add a parameter that will allow a user to assign a particular port within the given range.
  • Investigate the best way to work over HTTPS without issues
  • We are implementing asynchronous versions of existing API methods
  • Take constructive feedback and bug reports from our Beta Customers. We will be releasing new versions of the Beta as we respond to issues found in the field.

Update 08/28/2015

If the Web Service fails to install, try and turn off your Anti-virus software before installing.

 

Update 09/09/2015

We apologize for the delay of the next version of the Beta.  We’ve have been working on full HTTPS support, for which testing is ongoing, we found some issues and want to fix them before releasing.  We’ve also reproduced the service not recognizing networked printers.  We are investigating the possible solutions since it appears to be a limitation of what the service has access to.  We’ll keep you informed of any developments.

Dec 042014
 

A some may be already aware of, Google has announced that it will phase out support for NPAPI in Chrome with the ultimate removal in Sept 2015.   We use NPAPI in the framework for plugin support for most browsers except for IE which we use an ActiveX plugin.  We are investigating alternatives to NPAPI but we have not come up with a solution yet.

In the mean time before Sept 2015, you will have to possibly change several settings in your Chrome browser in order to use the DYMO Label Framework:

  1. Click on the Chrome Customize button in the upper right of your browser
  2. Find the Settings option
  3. Click on the “Show Advanced Options” link
  4. Click on the “Content Settings” button or browse to chrome://settings/content
  5. Verify that “Allow all sites to run JavaScript” is enabled
  6. Verify that under Plug-ins that “Run Automatically” is selected
    1. You can check in the “Plug-in exceptions” to see if the site you are running the Framework from is set to “Allow” instead of “Block”
  7. Verify that “Unsandboxed plug-in access” is not set to “Do not allow any sites….”

ChromeSettings

 

This should get things working.

Another work around, though less than ideal is to use the extension IE Tab.  This will put a web page into an IE browser tab within Chrome and will use the ActiveX plugin instead of the NPAPI version.  It has options to add a wild card URL that will automatically use the IE Tab when it matches.  We recognize that this is not a valid long term solution.

Update (4/15/2015)
With version 42 of Chrome, Google now disables NPAPI which is required to run our plugin. However, you can manually enable it by typing the following into the Chrome address bar and adjusting the setting:
chrome://flags/#enable-npapi

Update (4/20/2015)
It has been our experience that just enabling NPAPI may not be enough. In some instances, close the chrome browser then uninstall and re-install the DLS software for the plugin to appear in the plugin list: chrome://plugins/
Go here to see if your browser has the framework installed correctly: Check Environement

Update (5/8/2015)
In some situations, a full shutdown and reboot is required after all the steps have been performed for the plugin to appear in Chrome.

Nov 202013
 

Hello everyone!

A new version of our JavaScript library is now available. This release addresses compatibility issues with IE11. If your web application is compatible with IE11, we strongly recommend that you upgrade to the new version.

The new DYMO Label Framework JavaScript Library 1.2.5 is available here:  http://labelwriter.com/software/dls/sdk/js/DYMO.Label.Framework.1.2.5.js

The latest has been updated to version 1.2.5 as well: http://labelwriter.com/software/dls/sdk/js/DYMO.Label.Framework.latest.js

Jan 152013
 

Hello again!

We would like to get some feedback about what printers all of our SDK developers are using. Answer in the poll below and let us know which printer/printers you are using in your DYMO SDK applications. Thanks!

[polldaddy poll=6808778]

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!

Dec 162011
 

The previous post demonstrated different ways of printing QR-code from a .NET application. This blog post will demonstrate how to achieve the same goal from a web application. The complete sample is available here. The corresponding JavaScript is here.

Prerequisites

First, make sure the latest DYMO Label software is installed. It is always available on DYMO web-site, at the time of writing it is version 8.3.1.

Use Barcode Object

The easiest way to print QR-code is to use built-in support for QR-code in DYMO Label Framework. First, design your label using DYMO Label software. Unfortunately, DYMO Label itself does not have ability to specify QR-code barcode type in the UI yet. So, add the Barcode object to the label and put it into desired position. Don’t specify the barcode symbology, use the default Code39. Save the label in to a file, open the file in any XML editor and change thetag to “QRCode”.

<BarcodeObject>
    <Name>Barcode</Name>
    <ForeColor Alpha="255" Red="0" Green="0" Blue="0" />
    <BackColor Alpha="0" Red="255" Green="255" Blue="255" />
    <LinkedObjectName></LinkedObjectName>
    <Rotation>Rotation0</Rotation>
    <IsMirrored>False</IsMirrored>
    <IsVariable>False</IsVariable>
    <Text></Text>
   <Type>QRCode</Type>
    <Size>Large</Size>
    <TextPosition>None</TextPosition>
    <TextFont Family="Arial" Size="8" Bold="False" Italic="False" Underline="False" Strikeout="False" />
    <CheckSumFont Family="Arial" Size="8" Bold="False" Italic="False" Underline="False" Strikeout="False" />
    <TextEmbedding>None</TextEmbedding>
    <ECLevel>0</ECLevel>
    <HorizontalAlignment>Left</HorizontalAlignment>
    <QuietZonesPadding Left="0" Top="0" Right="0" Bottom="0" />
</BarcodeObject>

See Barcode.label from the sample. After the label is ready, the actual steps to print it is quite easy: open the label, set desired data, print. Here is a snippet from the sample:

printButton.onclick = function()
{
    try
    {
        if (!barcodeLabel)
            throw "Load label before printing";

        if (!printersSelect.value)
            throw "Select printer.";

        barcodeLabel.setObjectText('Barcode', 'http://developers.dymo.com');
        barcodeLabel.print(printersSelect.value);
    }
    catch(e)
    {
        alert(e.message || e);
    }
}

First, we check that the label is loaded and the printer is selected. Next, the barcode data is set to be the blog’s URL. And finally, the label is printed.

Use Image Object

Printing QR-code by using Barcode object is easy. The only drawback, it is hard to control the actual barcode size. tag can be used for that but it support only three predefined sizes Small/Medium/Large, but still the overall size will depend on the actual barcode data. The longer the data string, the larger is the barcode. So, the idea is to use some library to generate QR-code image of desired size, and then print it using the Image object. As before, design a label using DYMO Label software. Put an Image object on the label where the barcode should be printed. Set the Image objet size to the desired barcode size. When specifying the barcode image size in pixels calculate it based on the printer resolution, that is 300 dpi for LabelWriter printers and 180 dpi for Tape printers. For example, if you want the barcode to be 1” in size, specify the barcode image size as 300×300 pixels. See BarcodeAsImage.label from the sample project.

Image object accepts image data as a string that contains base64-encoded png stream. The question is, how to get/generate this string. Again, there are several ways of doing that.

Generate and base64-encode QR-code image on the server-side

One way is to generate QR-code image on the server using some library. Then encode the image using base64 and return it to the client as a string. Finally, on the client side, call setObjectText on the Image object and print.

printAsImageButton.onclick = function()
{
    try
    {
        if (!barcodeAsImageLabel)
            throw "Load label before printing";

        if (!printersSelect.value)
            throw "Select printer";

        $.get("qr.base64", function(qr)
        {
            try
            {
                barcodeAsImageLabel.setObjectText('Image', qr);

                barcodeAsImageLabel.print(printersSelect.value);
            }
            catch(e)
            {
                alert(e.message || e);
            }
        }, "text");

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

In the sample, we just request “qr.base64” resource that contains precalculated QR-code image for “http://developers.dymo.com”. In real application, you will probably pass the data to be encoded as a resource parameter.

Generate QR-code image on the server-side and base64-encode it on the client-side.

Base64-encoded strings are larger then binary png data. So, to reduce network traffic, we can return original png data from the server and base64-encode it on the client. To encode the data we will create , render our image on it, and then get encoded data using canvas.toDataURL() method.

printAsImageCanvasButton.onclick = function()
{
    try
    {
        if (!barcodeAsImageLabel)
            throw "Load label before printing";

        if (!printersSelect.value)
            throw "Select printer.";

        var img = new Image();
        img.onload = function()
        {
            try
            {
                var canvas = document.createElement('canvas');
                canvas.width = img.width;
                canvas.height = img.height;

                var context = canvas.getContext('2d');
                context.drawImage(img, 0, 0);

                var dataUrl = canvas.toDataURL('image/png');
                var pngBase64 = dataUrl.substr('data:image/png;base64,'.length);

                barcodeAsImageLabel.setObjectText('Image', pngBase64);
                barcodeAsImageLabel.print(printersSelect.value);
            }
            catch(e)
            {
                alert(e.message || e);
            }
        };
        img.onerror = function()
        {
            alert('Unable to load "qr.png"');
        };
        img.src = 'qr.png';
    }
    catch(e)
    {
        alert(e.message || e);
    }
}

Note: image loading is asynchronous process. So, we can’t just assign img.src property and immediately draw it on a canvas; we have to wait until the image is loaded completely from the server. To handle that, we do main work in onload handler. also, toDataURL returns data url, to get the data itself, we have to remove the url prefix.

Again, as in the previous case, qr.png resource contains recalculated QR-code image for “http://developers.dymo.com”. In real application, you will probably pass the data to be encoded as a resource parameter.

A drawback of this method is that it requires support in the browser. All major browsers already support it, but be aware that in Internet Explorer it is supported starting from version 9 only.

Use third-party service

Instead of generating QR-code image on your own server, is it possible to use one of the many free online QR-code generator/service? The answer is yes, but it is even more trickier than the previous way. The problem, as usual in web development, is the security. But default is it not possible to grab canvas pixels if an image from a different domain has been drawn on the canvas. It is possible to overcome it, but it requires three parties to participate properly. First, your JavaScript has to set img.crossOrigin property to ‘anonymous’. This will tell the browser that you are trying to access a cross-domain resource, so the browser can send appropriate request headers, e.g. the browser will not send cookies. Next, the server itself should allow its resources to be accessible from other domains. Only few of many QR-code online generators do allow it. And the last, the browser itself should support CORS for . It is very recent addition to the standards, so at the time of writing only Chrome does support it. In any other browsers you will still get “security exception” error. Here are some links regarding and cross-domain limitations:

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#security-with-canvas-elements

http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html

http://code.google.com/p/chromium/issues/detail?id=82042

Update (2011-12-20): works in Firefox 9 as well.

printAsImageCanvas2Button.onclick = function()
{
    try
    {
        if (!barcodeAsImageLabel)
            throw "Load label before printing";

        if (!printersSelect.value)
            throw "Select printer.";

        var img = new Image();
        img.crossOrigin = 'anonymous';
        img.onload = function()
        {
            try
            {
                var canvas = document.createElement('canvas');
                canvas.width = img.width;
                canvas.height = img.height;

                var context = canvas.getContext('2d');
                context.drawImage(img, 0, 0);

                var dataUrl = canvas.toDataURL('image/png');
                var pngBase64 = dataUrl.substr('data:image/png;base64,'.length);

                barcodeAsImageLabel.setObjectText('Image', pngBase64);
                barcodeAsImageLabel.print(printersSelect.value);
            }
            catch(e)
            {
                alert(e.message || e);
            }
        };
        img.onerror = function()
        {
            alert('Unable to load qr-code image');
        };
        img.src = 'https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=http%3A//developers.dymo.com&choe=UTF-8';
    }
    catch(e)
    {
        alert(e.message || e);
    }
}

The code is very similar to the previous example. The only difference is that we set img.crossOrigin property and we use Google’s Infographics API to generate the qr-code image. Notice that in this example the image is generated dynamically, and barcode data is passed as the part of the url.

Pure client-side JavaScript

At the time of writing, it seems there is no self-contained pure JavaScript solutions to create QR-code images using <canvas> completely on the client-side. In the future it might be one more way of doing QR-code printing.

Conclusion

It is quite simple to print QR-code barcode even if built-in support is somewhat limited.