Dymo 4 line address label - Strange results

31 Views Asked by At

I have a function that prints address labels to a Dymo 550. Addresses with 3 lines print as expected. If I print a 4 line address, the 2nd address line comes out first, then a blank line, then the rest of the address.

Any ideas on what could be happening?

Code:

$("#SubmitPrintOnly").click(function () {
        var address = `Arthur Fonzarelli
565 North Clinton Drive
Milwaukee WI 45193`;

        printLabel(address);
    });

function printLabel(mailingAddress) {
        var labelXml = '<?xml version="1.0" encoding="utf-8"?>\
        <DieCutLabel Version="8.0" Units="twips">\
            <PaperOrientation>Landscape</PaperOrientation>\
            <Id>Text</Id>\
            <PaperName>30321 Large Address</PaperName>\
            <ObjectInfo>\
                <TextObject>\
                    <Name>Address</Name>\
                    <ForeColor Alpha="255" Red="0" Green="0" Blue="0" />\
                    <BackColor Alpha="0" Red="255" Green="255" Blue="255" />\
                    <Rotation>Rotation0</Rotation>\
                    <IsMirrored>False</IsMirrored>\
                    <HorizontalAlignment>Left</HorizontalAlignment>\
                    <VerticalAlignment>Middle</VerticalAlignment>\
                    <TextFitMode>ShrinkToFit</TextFitMode>\
                    <UseFullFontHeight>True</UseFullFontHeight>\
                    <Verticalized>False</Verticalized>\
                    <StyledText />\
                    <BarcodePosition> Suppress</BarcodePosition>\
                </TextObject>\
                <Bounds X="332" Y="300" Width="4455" Height="1260" />\
            </ObjectInfo>\
        </DieCutLabel>';

        var label = dymo.label.framework.openLabelXml(labelXml);
        label.setObjectText("Address", mailingAddress);
        label.print("@System.Configuration.ConfigurationManager.AppSettings["LabelPrinterName"]");

        return true;
    };

enter image description here

0

There are 0 best solutions below