My project involves printing patient labels on a Dymo 400 Turbo. I have installed the latest framework, DYMO.Label.Framework.latest.js, and am trying to use one approach I have found on the web to print the label. My problem is that the XML was designed for an address label and not a longer patient label. When I send to the printer it advances past the next label, wasting one. Plus I want to print the ID not the address or zip code in the bar code. Anyone have any ideas?
This is my XML:
'<?xml version="1.0" encoding="utf-8"?>\
<DieCutLabel Version="8.0" Units="twips">\
<PaperOrientation>Landscape</PaperOrientation>\
<Id>Address</Id>\
<PaperName>30252 Address</PaperName>\
<DrawCommands>\
<RoundRectangle X="0" Y="0" Width="1581" Height="5040" Rx="270" Ry="270" />\
</DrawCommands>\
<ObjectInfo>\
<AddressObject>\
<Name>Address</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>True</IsVariable>\
<HorizontalAlignment>Left</HorizontalAlignment>\
<VerticalAlignment>Middle</VerticalAlignment>\
<TextFitMode>ShrinkToFit</TextFitMode>\
<UseFullFontHeight>True</UseFullFontHeight>\
<Verticalized>False</Verticalized>\
<StyledText>\
<Element>\
<Attributes>\
<Font Family="Arial" Size="8" Bold="False" Italic="False" Underline="False" Strikeout="False" />\
<ForeColor Alpha="255" Red="0" Green="0" Blue="0" />\
</Attributes>\
</Element>\
</StyledText>\
<LineFonts>\
<Font Family="Arial" Size="8" Bold="False" Italic="False" Underline="False" Strikeout="False" />\
<Font Family="Arial" Size="8" Bold="False" Italic="False" Underline="False" Strikeout="False" />\
<Font Family="Arial" Size="8" Bold="False" Italic="False" Underline="False" Strikeout="False" />\
</LineFonts>\
</AddressObject>\
<Bounds X="332" Y="150" Width="4455" Height="1260" />\
</ObjectInfo>\
</DieCutLabel>'
I load up the label with this:
var label = dymo.label.framework.openLabelXml(labelXml);
var labelToPrint = getLabelToPrint();
if (!label) {
$("#lblError").text("There is no information entered to print");
$("#MessageDialog").dialog({ title: "No Information" });
$("#MessageDialog").dialog("open");
return;
}
if (label.getAddressObjectCount() > 0) {
var add = label.getAddressText(0);
label.setAddressText(0, labelToPrint);
}
// set data using LabelSet and text markup
var labelSet = new dymo.label.framework.LabelSetBuilder();
var textMarkup = '';
var fontSize = 18; // sets font size of first line
if (labelToPrint == '') {
$("#lblError").text("There is no information entered to print");
$("#MessageDialog").dialog({ title: "No Information" });
$("#MessageDialog").dialog("open");
return false;
}
else {
var lines = labelToPrint.split('\n');
var boldLinesCount = lines.length <= 3 ? 1 : 2;
for (var x = 0; x < lines.length; x++) {
textMarkup += lines[x] + '\n';
}
//textMarkup += lines[0] + '\n';
//textMarkup += lines[1] + '\n';
//textMarkup += lines[2];
label.setAddressText(0, textMarkup);
//label.setObjectText("Barcode", lines[0]);
label.setObjectText("Address", textMarkup);
var record = labelSet.addRecord();
record.setTextMarkup('Text', textMarkup); // set label text
}
I fixed the issue by adding this to the XML:
And then this in the function:
which is the item I want in the barcode.
Dymo LabelWriter 450. In 2016 the world is upside down with this printer and with there documentation. Its a hell and nightmare. Dymo? please document it well.
Step 1:
A) Get latest versions of Javascript library and there driver
B) old versions are screwed, full waste of time. C) better place to get start with: http://developers.dymo.com/2016/01/05/dymo-label-software-version-8-5-3-for-patch-release-macwin/
Step 2: copy paste, and smile.
Step 3: Printed correctly and console output was correct for debugging.