Name | Modified | Size | Downloads / Week |
---|---|---|---|
Unzipped-src | 2015-06-30 | ||
README.txt | 2015-06-30 | 2.9 kB | |
chromeDymo-1.0a.zip | 2015-06-30 | 7.2 MB | |
Totals: 3 Items | 7.2 MB | 0 |
INSTALLING ---------------------------------------------- Unzip chromeDymo.zip to your desired install location & run install.bat and register.bat as administrator to set the server as a global startup in windows. DEMO ---------------------------------------------- See demo.html for a working example. (Using video spine label) USAGE ---------------------------------------------- Once the node server is running, you may print by simply POSTing your data to either http://tablet.sigwebtablet.com:8081/ OR https://tablet.sigwebtablet.com:8082/ depending on the schema of your web application. The POST may (but does not have to) contain up to 4 fields: thing - the xml to be printed printer - name of the DYMO printer to print to tray - printer tray to use copies - number of copies You may obtain a list of available printers by sending a GET request to the same address. The request returns a JSON object with one variable "printers" which contains a list of | separated printers. Example: $.get("https://tablet.sigwebtablet.com:8082/").done(function(resp){ var obj = JSON.parse(resp); var printerArray = obj.printers.split("|"); //alert(printerArray[0]); var label = dymo.label.framework.openLabelXml(dieCutLabelLayout); label.setObjectText("Text", 'Some words go here'); label.setObjectText("Text2", 'Other words here'); label.setObjectText("Text3", 'info0'); label.setObjectText("ItemCode", '1FF4EQ'); $.post("https://tablet.sigwebtablet.com:8082/", { thing: label.getLabelXml(), printer: printerArray[0], tray: '0', copies: '2' }) .done(function(resp){ //alert(Xml.serialize(labelDom)); }); }); ---------------------------------- Fonts: Presently it's easiest to change all fonts for the entire label, setting individual fonts for different objects is still a bit cumbersome. To change the entire label's font you can use the following method: $.get("https://tablet.sigwebtablet.com:8082/").done(function(resp){ var obj = JSON.parse(resp); var printerArray = obj.printers.split("|"); //alert(printerArray[0]); var label = dymo.label.framework.openLabelXml(dieCutLabelLayout); label.setObjectText("Text", 'Some words go here'); label.setObjectText("Text2", 'Other words here'); label.setObjectText("Text3", 'info0'); label.setObjectText("ItemCode", '1FF4EQ'); var labelDom = Xml.parse(label.getLabelXml()); //PARSE MODIFIED LABEL AS OBJECT var x = labelDom.getElementsByTagName('Font'); //LOAD ALL FONT TAGS IN XML for(var i = 0; i < x.length; i++) //LOOP THROUGH EACH TAG x[i].setAttribute("Family", "Courier New"); //SET DESIRED ATTRIBUTE $.post("https://tablet.sigwebtablet.com:8082/", { thing: Xml.serialize(labelDom), printer: printerArray[0], tray: '0', copies: '2' }) .done(function(resp){ //alert(Xml.serialize(labelDom)); }); });