Search Results : javascript » DYMO Developer SDK Support Blog

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.

Aug 102015
 

As many of you know, Google is removing support for NPAPI in the Chrome browser. Our existing JavaScript SDK utilizes this API. We have been diligently working on a new communication mechanism that will work on all browsers and will avoid such things as NPAPI and Active-X and will decouple the SDK from browser specific implementations.

The good news is that we are currently testing our new communication protocol and it will be ready for a Beta release soon.

We have worked hard to make sure that the new SDK will be backwards compatible. There will be the addition of an initialization method, but the existing API works the same.

Our new SDK will utilize TCP/IP to communicate between the browser and a Windows service running on the client machine. The new service will be installed with DLS when upgrading to the new version. A range of ports will be available for our windows service, if the browser cannot bind to one of the ports, it will fall back to our legacy plug-in architecture. For additional security, the service will accept connections only from localhost.
Stay tuned to this blog for more information.

Mar 242014
 

Hello everyone!

A new version of our JavaScript library is now available. This version fixes several printing issues specific to Internet Explorer 11.

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

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

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

Nov 172011
 

Here is one more sample demonstrates capabilities of DYMO Label JavaScript library. The correspondent JavaScript file is here.

Getting Printers

First, the sample shows how to retrieve a list of available DYMO printers. For each printer it shows all the available properties. To get the printer list use dymo.label.framework.getPrinters function. The function returns an array contains information regarding each printer. The sample calls getPrinters and then put all the information onto a table, see createPrintersTable() for details.

Note: There are helpful function to filter the result list to contain only LabelWriter or Tape printers; use dymo.label.framework.getLabelWriterPrinters or dymo.label.framework.getTapePrinters accordingly. This might be useful if your application is designed to print on die-cut labels or D1 tapes only.

Print Multiple Labels

Next, the sample shows how to print multiple labels at once, in one print job. The sample leverages the library’s LabelSet functionality do archive that. For each printer the sample creates one label set record represent data to be printed on one label. also the sample demonstrates how to apply different text styles to the print data. It uses a feature called text markup, the ability to apply formatting attributes/tags very similar to HTML ones. 

// create label set to print printers' data
var labelSetBuilder = new dymo.label.framework.LabelSetBuilder();
for (var i = 0; i < printers.length; i++)
{
    var printer = printers[i];

    // process each printer info as a separate label
    var record = labelSetBuilder.addRecord();

    // compose text data
    // use framework's text markup feature to set text formatting
    // because text markup is xml you can use any xml tools to compose it
    // here we will use simple text manipulations to avoid cross-browser compatibility.
    var info = "<font family='Courier New' size='14'>"; // default font
    info = info + "Printer: <b>" + printer.name + "n</b>"; 
    info = info + "PrinterType: " + printer.printerType;
    info = info + "n<font size='10'>is local: " + printer.isLocal;
    info = info + "nis online: " + printer.isConnected + "</font>";

    if (typeof printer.isTwinTurbo != "undefined")
    {
        if (printer.isTwinTurbo)
            info = info + "<i><u><br/>The printer is TwinTurbo!!!</u></i>";
        else
            info = info + "<font size='6'><br/>Oops, the printer is NOT TwinTurbo</font>";
    }

    if (typeof printer.isAutoCutSupported != "undefined")
    {
        if (printer.isAutoCutSupported)
            info = info + "<i><u><br/>The printer supports auto-cut!!!</u></i>";
        else
            info = info + "<font size='6'><br/>The printer does not supports auto-cut</font>";
    }

    info = info + "</font>";

    // when printing put info into object with name "Text"
    record.setTextMarkup("Text", info);
}

See print() function for a complete sample.

Note: Here is another blog post regarding using text markup. And one more regarding printing multiple labels.

Oct 072011
 

A new version of DYMO Label Framework JavaScript library is available.

This version adds support for Opera 11.51 on Mac and Windows.

The js script file is available from http://labelwriter.com/software/dls/sdk/js/DYMO.Label.Framework.1.2.4.js.

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

Oct 042011
 

There are two ways of providing dynamic text data to be printed on your labels. In both cases the text can be “styled”, so different parts of the text will use different fonts, sizes and/or styles.

The first way covers most use cases for text formatting needs, it is simple, and, of cause, has some limitations. The limitation is that it supports line-by-line formatting only. So, each line can have its own formatting, but all characters in the same line will use the same formatting. If this is OK for your application, then here are the steps needed to utilize this method. first, you have to design you label layout/template. The easiest way to design a label is by using DYMO Label software. While designing, type a sample data for a label object, and apply some formatting, on line by line basis, e.g. make the first line bold, save the file, and put it on your server. 

image

Those are manual steps, now we will need some JavaScript. Load the label by using openLabelXml. Now you can set your real data by using setLabelText or, if you need to print multiple labels, by using a LabelSet. You pass a plain string without any formatting to the setLabelText method, and the library will apply line-by-line formatting for you based on the sample data in the label file. For example, if you call setLabelText(‘Will E. CoyotenACME Birdingn2200 Desert Meadows WaynLas Vegas, NV 89122’), the output will be like that:

image

The second way to format the text is by using so called “Text Markup” feature. It is some what more complex than the first formatting method, but in return you have the full control over the font attributes and can do character-by-character formatting. First, you design your label as described above, but you don’t have to specify any sample data. Next you have to construct a “text markup”.  A text markup is an xml string contains tags controlling font attributes, plus plain text data. The Supported tags are ones similar to HTML tags: <font>, <b>, <i>, <u>, <s>, <br>. Full xml-schema definition is available here. After you have the markup text, you can print it by using a LabelSet and setTextMarkup method.

var labelSet = new dymo.label.framework.LabelSetBuilder();
var record = labelSet.addRecord();

var textMarkup = '...';
record.setTextMarkup('Text', textMarkup);
label.print('DYMO LabelWriter 450', null, labelSet.toString());

Here is an example demonstrates different formatting capabilities: http://labelwriter.com/software/dls/sdk/samples/js/TextMarkup/TextMarkup.html, and the corresponded JavaScript http://labelwriter.com/software/dls/sdk/samples/js/TextMarkup/TextMarkup.js. Type anything into the “Text to Print” text box and click on any button below. The output should correspond to the button’s caption. The corresponded text markup will be copied to the “Text Markup” text box, so you can examine it without going into JavaScript debugger. Also, you can just type any text markup in the box and print it by clicking on “Print text markup” button. Just make sure it is a correct xml and correct markup. If it is not, a runtime error/exception is thrown.

Sep 162011
 

A new version of DYMO Label Framework JavaScript library is available.

This version improves detection of supported browsers, or more precise unsupported ones. There is a known problem with Safari 5.1 running in 32-bit mode on both Mac OS X 10.6 and 10.7. Before version 1.2.3 the library did not detect this problem. Now, the call to dymo.label.framework.checkEnvironment() will return an error.

The js script file is available from http://labelwriter.com/software/dls/sdk/js/DYMO.Label.Framework.1.2.3.js.

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

Sep 072011
 

A new version of DYMO Label Framework JavaScript library is available.

Thanks to our friends at lambslist.com a subtle bug in Mac version of DYMO Label software has been discovered (and fixed). The problem manifests itself at print time, when the label data is printed using the default font instead of one specified in the label file. The fix for DYMO Label software is scheduled for the next release, 8.4. In the meantime the js script library has been updated to include a workaround for the problem.

The js script file is available from http://labelwriter.com/software/dls/sdk/js/DYMO.Label.Framework.1.2.2.js.

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