function TestPrint(templateName) {
    var pageSize = { IntOrient: 0, PageWidth: 700, PageHeight: 500, StrPageName: 'A4' };
    //var pageSize = { IntOrient: 3, PageWidth: 520, PageHeight: 0, StrPageName: 'CreateCustomPage' };
    //PrintWithTemplate('outPrinterGK888t', [templateName], [{}], false, pageSize)
    //PrintWithTemplate('outPrinterAB58GK', [templateName], [{}], 'design', pageSize)
    PrintWithTemplate('outPrinterGK888t', [templateName], [{}], 'design', pageSize)
}

// 全局调用方法
function PrintWithTemplate(printerIndex, templateNames, jsonDataArray, isPrint, pageSize, callback) {
    // 1. 参数预处理（字符串转数组）
    try {
        // 处理templateNames（可以是数组或逗号分隔的字符串）
        if (typeof templateNames === 'string') {
            // 简单分割字符串："Label1,Label2" => ["Label1", "Label2"]
            //templateNames = templateNames.split(',').map(item => item.trim());
            templateNames.split(',').map(function (item) { return item; });
        } else if (!(templateNames instanceof Array)) {
            alert("模板名称参数必须是数组或逗号分隔的字符串！");
            return;
        }

        // 处理jsonDataArray（可以是数组或JSON字符串数组）
        if (typeof jsonDataArray === 'string') {
            // 尝试解析JSON字符串：'["{...}", "{...}"]' => ["{...}", "{...}"]
            jsonDataArray = parseJsonWithoutJson2(jsonDataArray) || [];
            if (!(jsonDataArray instanceof Array)) {
                // 可能是逗号分隔的JSON字符串
                //jsonDataArray = jsonDataArray.split(/(?<=}),(?={)/).map(item => item.trim());
                //jsonDataArray = jsonDataArray.split(/(?<=}),(?={)/).map(function (item) { return item; });
                jsonDataArray = jsonDataArray.split('},{').map(function (item, index) {
                    return (index === 0 ? item : '{' + item).replace(/^\s+|\s+$/g, '');
                });
            }
        } else if (!(jsonDataArray instanceof Array)) {
            alert("数据参数必须是数组或JSON字符串数组！");
            return;
        }
    } catch (e) {
        alert("参数解析错误：" + e.message);
        return;
    }

    // 2. 参数校验
    if (templateNames.length !== jsonDataArray.length) {
        alert("模板数量(" + templateNames.length + ")与数据数量(" + jsonDataArray.length + ")不匹配！");
        return;
    }

    // 3. 获取Lodop对象
    var LODOP = getLodop();
    // LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
    if (!LODOP) {
        alert("打印控件未安装！");
        return;
    }

    if (pageSize === undefined) {
        pageSize = {
            IntOrient: 0,//打印方向及纸张类型。 1: 纵向打印，固定纸张。 2: 横向打印，固定纸张。 3: 纵向打印，宽度固定，高度自适应内容。 0: 默认方向，由用户或打印机设置决定。
            PageWidth: 700,//自定义纸张宽度，单位为 0.1 毫米。例如，2100 表示 210 毫米。
            PageHeight: 500,//自定义纸张高度，单位同上。当高度为 0 时，strPageName 参数生效。
            StrPageName: 'A4' //纸张名称，如 "A4", "Letter" 等。仅在宽度和高度为 0 时有效
        }
    }
    // 4. 初始化打印设置
    LODOP.PRINT_INIT("批量打印任务");
    //LODOP.PRINT_INITA(0, 0, 262, 203, "");
    LODOP.SET_PRINT_PAGESIZE(pageSize.IntOrient, pageSize.PageWidth, pageSize.PageHeight, pageSize.StrPageName);
    LODOP.SET_PRINT_MODE("RESELECT_PRINTER", true);
    LODOP.SET_PRINTER_INDEXA(printerIndex); // 设置打印机

    // 5. 批量打印
    for (var i = 0; i < templateNames.length; i++) {
        var templateName = templateNames[i];
        var jsonData = jsonDataArray[i];

        // 5.1 解析数据
        var data;
        if (typeof jsonData === 'string') {
            try {
                data = parseJsonWithoutJson2(jsonData);
                if (!data) throw new Error("数据格式错误");
            } catch (e) {
                alert("第" + (i + 1) + "条数据解析失败: " + e.message);
                continue;
            }
        } else if (typeof jsonData === 'object') {
            data = jsonData;
        } else {
            alert("第" + (i + 1) + "条数据格式无效");
            continue;
        }

        // 5.2 检查模板
        if (!PrintTemplates[templateName]) {
            alert("第" + (i + 1) + "个模板不存在: " + templateName);
            continue;
        }

        // 5.3 执行打印
        if (data instanceof Array) {
            for (var j = 0; j < data.length; j++) {
                var printData = data[j];
                try {
                    if (i > 0 || j > 0) LODOP.NewPage();  // 先分页再添加内容（第一页除外）
                    PrintTemplates[templateName](LODOP, printData);
                } catch (e) {
                    alert("打印[" + templateName + "]时第" + (j + 1) + "条数据出错: " + e.message);
                }
            }
        }
        else {
            try {
                if (i > 0) LODOP.NewPage();  // 先分页再添加内容（第一页除外）
                PrintTemplates[templateName](LODOP, data);
            } catch (e) {
                alert("打印[" + templateName + "]时出错: " + e.message);
            }
        }
    }

    // 检测老版本Chrome
    var isOldChrome = navigator.userAgent.indexOf('Chrome/27') > -1;

    if (!isOldChrome && typeof callback === 'function') {
        LODOP.On_Return = function (taskID, value) {
            console.log(taskID);
            callback();
        };
    }

    //6. 最终输出
    if (isPrint === 'False' || isPrint === 'false' || isPrint === false) {
        LODOP.PREVIEW();
        //LODOP.PRINT_DESIGN();
    }
    else if (isPrint === 'design')
    {
        LODOP.PRINT_DESIGN();
    }
    else {
        LODOP.PRINT();
    }
    //LODOP.PREVIEW();
    //LODOP.PRINT_DESIGN();
    if (isOldChrome) {
        setTimeout(function () {
            if (typeof callback === 'function') callback();
        }, 500);
    }
}

function parseJsonWithoutJson2(jsonStr) {
    // 简单检查是否是合法JSON（非严谨，生产环境建议增强校验）
    //if (typeof jsonStr !== 'string' || !(jsonStr.startsWith('{') && jsonStr.endsWith('}') || !(jsonStr.startsWith('[') && jsonStr.endsWith(']')))) {
    if (typeof jsonStr !== 'string' ||
        !((jsonStr.charAt(0) === '{' && jsonStr.charAt(jsonStr.length - 1) === '}') ||
            (jsonStr.charAt(0) === '[' && jsonStr.charAt(jsonStr.length - 1) === ']'))
    ) {
        return null;
    }

    try {
        // 使用eval解析
        return eval('(' + jsonStr + ')');
    } catch (e) {
        // 降级处理
        try {
            // 极简的JSON解析（仅支持基本结构）
            return (new Function('return ' + jsonStr))();
        } catch (e2) {
            //if (window.console && console.error) {
            //    console.error('JSON解析失败:', e2);
            //}
            alert("JSON解析失败！");
            return null;
        }
    }
}

// 标签打印模板
var PrintTemplates = {
    // 转站配送
    TransferDelivery: function (LODOP, data) {
        //data = {OrderNo: 'P06160002',ReceName: '45545544545545',Mobile: '18208661680',WareGroup: 'PP-218',
        //    CustomerCode: 'KH11720', Qty: '1', Address: 'Phnom Penh Chamkarmon 51s St Silver, Phnom Penh, Cambodia|HJASDHSADASHDKJ',
        //    WareKhName: '', WareTel:'',
        //    BoxSerialNo: 'XLTKH16120800002', Weight:'45.21',Size:'12.00*45.21*12.22'
        //};
        if (data.Size.length > 0) {
            data.Size = data.Size.replace('.00', '');
        }
        LODOP.ADD_PRINT_RECT(0, 0, 255, 188, 0, 1);
        LODOP.ADD_PRINT_SHAPE(4, 0, 0, 100, 55, 0, 1, "#000000");
        LODOP.ADD_PRINT_TEXT(4, 0, 100, 30, "Transfer Site");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(29, 0, 100, 24, data.WareGroup);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        if (data.OrderNo.length > 9) {
            LODOP.ADD_PRINT_BARCODE(6, 125, 144, 47, "128Auto", data.OrderNo);
        }
        else {
            LODOP.ADD_PRINT_BARCODE(6, 107, 144, 47, "128Auto", data.OrderNo);
        }
        LODOP.ADD_PRINT_RECT(55, 0, 255, 60, 0, 1);
        LODOP.ADD_PRINT_TEXT(60, 2, 225, 15, data.ReceName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(75, 2, 230, 15, data.Mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(89, 2, 252, 24, data.Address);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);

        LODOP.ADD_PRINT_TEXT(54, 216, 34, 48, "A");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 30);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        var htmlContent = "<div style='font-family: KhmerOSFont;font-size: 12px;text-align:center'>" + data.WareKhName + "</div>";
        LODOP.ADD_PRINT_HTM(126, 0, 125, 30, htmlContent);

        LODOP.ADD_PRINT_TEXT(153, 0, 125, 30, data.WareTel);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_RECT(115, 125, 130, 73, 0, 1);

        if (data.Qty === 1 || data.Qty === '1') {
            LODOP.ADD_PRINT_TEXT(115, 124, 130, 30, data.CustomerCode);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            if (data.CustomerCode && data.CustomerCode.length > 7) {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            }
            else {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 20);
            }
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

            LODOP.ADD_PRINT_TEXT(143, 124, 130, 20, data.BoxSerialNo);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.ADD_PRINT_TEXT(165, 118, 140, 20, data.Size + '/' + data.Weight + "KG");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        }
        else {
            LODOP.ADD_PRINT_TEXT(125, 124, 130, 30, data.CustomerCode);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            if (data.CustomerCode && data.CustomerCode.length > 7) {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
            }
            else {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 22);
            }
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

            LODOP.ADD_PRINT_TEXT(160, 125, 130, 20, "Pcs：" + data.Qty);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        }
    },
    // 转本土单
    TransferLocal: function (LODOP, data) {
        //data = {
        //    OrderNo: 'P06160002', ReceName: '45545544545545', Mobile: '18208661680', WareGroup: 'PP-218',
        //    CustomerCode: 'KH11720', Qty: '1', Address: 'Phnom Penh Chamkarmon 51s St Silver, Phnom Penh, Cambodia|HJASDHSADASHDKJ',
        //    WareKhName: '站点柬文名称', WareTel: '站点联系电话',
        //    BoxSerialNo: 'XLTKH16120800002', Weight: '45.21', Size: '12.00*45.21*12.22'
        //};
        if (data.Size.length > 0) {
            data.Size = data.Size.replace('.00', '');
        }
        LODOP.ADD_PRINT_RECT(0, 0, 255, 188, 0, 1);
        LODOP.ADD_PRINT_SHAPE(4, 0, 0, 100, 55, 0, 1, "#000000");
        LODOP.ADD_PRINT_TEXT(4, 0, 100, 30, "LODA Local");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(29, 0, 100, 24, data.WareGroup);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        if (data.OrderNo.length > 9) {
            LODOP.ADD_PRINT_BARCODE(6, 125, 144, 47, "128Auto", data.OrderNo);
        }
        else {
            LODOP.ADD_PRINT_BARCODE(6, 107, 144, 47, "128Auto", data.OrderNo);
        }
        LODOP.ADD_PRINT_RECT(55, 0, 255, 60, 0, 1);
        LODOP.ADD_PRINT_TEXT(60, 2, 225, 15, data.ReceName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(75, 2, 230, 15, data.Mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(89, 2, 252, 24, data.Address);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);

        LODOP.ADD_PRINT_TEXT(54, 216, 34, 48, "A");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 30);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        var htmlContent = "<div style='font-family: KhmerOSFont;font-size: 12px;text-align:center'>" + data.WareKhName + "</div>";
        LODOP.ADD_PRINT_HTM(126, 0, 125, 30, htmlContent);
        LODOP.ADD_PRINT_TEXT(153, 0, 125, 30, data.WareTel);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_RECT(115, 125, 130, 73, 0, 1);

        if (data.Qty === 1 || data.Qty === '1') {
            LODOP.ADD_PRINT_TEXT(115, 124, 130, 30, data.CustomerCode);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            if (data.CustomerCode && data.CustomerCode.length > 7) {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            }
            else {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 20);
            }
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

            LODOP.ADD_PRINT_TEXT(143, 124, 130, 20, data.BoxSerialNo);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.ADD_PRINT_TEXT(165, 118, 140, 20, data.Size + '/' + data.Weight + "KG");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        }
        else {
            LODOP.ADD_PRINT_TEXT(125, 124, 130, 30, data.CustomerCode);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            if (data.CustomerCode && data.CustomerCode.length > 7) {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
            }
            else {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 22);
            }
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

            LODOP.ADD_PRINT_TEXT(160, 125, 130, 20, "Pcs：" + data.Qty);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        }
    },
    // 转单第三方
    TransferThirdParty: function (LODOP, data) {
        //data = {
        //    OrderNo: 'P06160002', ReceName: '45545544545545', Mobile: '18208661680', WareGroup: 'PP-218',
        //    CustomerCode: 'KH11720', Qty: '1', Address: 'Phnom Penh Chamkarmon 51s St Silver, Phnom Penh, Cambodia|HJASDHSADASHDKJ',
        //    WareKhName: '站点柬文名称', WareTel: '站点联系电话',
        //    BoxSerialNo: 'XLTKH16120800002', Weight: '45.21', Size: '12.00*45.21*12.22'
        //};
        if (data.Size.length > 0) {
            data.Size = data.Size.replace('.00', '');
        }
        LODOP.ADD_PRINT_RECT(0, 0, 255, 188, 0, 1);
        LODOP.ADD_PRINT_SHAPE(4, 0, 0, 100, 55, 0, 1, "#000000");
        LODOP.ADD_PRINT_TEXT(7, 0, 100, 40, "Third Party Express");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        if (data.OrderNo.length > 9) {
            LODOP.ADD_PRINT_BARCODE(6, 125, 144, 47, "128Auto", data.OrderNo);
        }
        else {
            LODOP.ADD_PRINT_BARCODE(6, 107, 144, 47, "128Auto", data.OrderNo);
        }
        LODOP.ADD_PRINT_RECT(55, 0, 255, 60, 0, 1);
        LODOP.ADD_PRINT_TEXT(60, 2, 225, 15, data.ReceName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(75, 2, 230, 15, data.Mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(89, 2, 252, 24, data.Address);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(54, 216, 34, 48, "A");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 30);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        if (data.Qty === 1 || data.Qty === '1') {
            LODOP.ADD_PRINT_RECT(115, 125, 130, 73, 0, 1);
            LODOP.ADD_PRINT_TEXT(135, 123, 130, 30, data.CustomerCode);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            if (data.CustomerCode && data.CustomerCode.length > 7) {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            }
            else {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 20);
            }
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(133, -3, 130, 20, data.BoxSerialNo);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(159, 12, 100, 20, data.Weight + "KG");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        }
        else {
            LODOP.ADD_PRINT_TEXT(129, 0, 256, 50, data.CustomerCode);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 30);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        }
    },

    // 转站配送
    TransferDeliveryOld: function (LODOP, data) {
        //data = {OrderNo: 'P06160002',ReceName: '45545544545545',Mobile: '18208661680',WareGroup: 'PP-218',
        //CustomerCode: 'KH11720', Qty: '5', Address: 'Phnom Penh Chamkarmon 51s St Silver, Phnom Penh, Cambodia|HJASDHSADASHDKJ',};

        LODOP.ADD_PRINT_RECT(0, 0, 255, 188, 0, 1);
        LODOP.ADD_PRINT_SHAPE(4, 0, 0, 100, 55, 0, 1, "#000000");
        LODOP.ADD_PRINT_TEXT(4, -4, 110, 30, "转站配送");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(29, 0, 100, 24, data.WareGroup);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        if (data.OrderNo.length > 9) {
            LODOP.ADD_PRINT_BARCODE(6, 125, 144, 47, "128Auto", data.OrderNo);
        }
        else {
            LODOP.ADD_PRINT_BARCODE(6, 107, 144, 47, "128Auto", data.OrderNo);
        }

        LODOP.ADD_PRINT_RECT(55, 0, 255, 60, 0, 1);
        LODOP.ADD_PRINT_TEXT(60, 2, 225, 15, "收货人：" + data.ReceName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(75, 2, 230, 15, "收货电话：" + data.Mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(89, 2, 252, 24, "收货地址：" + data.Address);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        //LODOP.ADD_PRINT_BARCODE(113, 17, 80, 80, "QRCode", "https://wap.loda.com.kh/delivery");
        LODOP.ADD_PRINT_BARCODE(122, 26, 104, 90, "QRCode", "https://wap.loda.com.kh/delivery");
        // https://wap.loda.com.kh/parcel-detail?id=" + data.BoxSerialNo
        LODOP.ADD_PRINT_RECT(115, 115, 140, 73, 0, 1);
        LODOP.ADD_PRINT_TEXT(123, 120, 130, 30, data.CustomerCode);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        if (data.CustomerCode) {
            if (data.CustomerCode.length > 7) {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            }
            else {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 20);
            }
        }
        else {
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 20);
        }

        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        if (data.Qty === 1 || data.Qty === '1') {
            LODOP.ADD_PRINT_TEXT(155, 120, 130, 30, data.BoxSerialNo);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        }
        else {
            LODOP.ADD_PRINT_TEXT(155, 120, 130, 30, "Pcs：" + data.Qty);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        }
    },
    // 转本土单
    TransferLocalOld: function (LODOP, data) {
        //data = {
        //    OrderNo: 'P06160002', ReceName: '45545544545545', Mobile: '18208661680',
        //    WareGroup: 'PP-218', WareKhName: 'ឃុំស្រែក្នុង (ស្រុកជុំគិរី)', WareTel: '15484215620',
        //    Address: 'Phnom Penh Chamkarmon 51s St Silver, Phnom Penh, Cambodia|HJASDHSADASHDKJ',
        //    Qty: 1,
        //    BoxSerialNo:'ZZ14545454545'
        //};
        LODOP.ADD_PRINT_RECT(0, 0, 255, 188, 0, 1);
        LODOP.ADD_PRINT_SHAPE(4, 0, 0, 100, 55, 0, 1, "#000000");
        LODOP.ADD_PRINT_TEXT(4, -4, 110, 30, "转本土单");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(29, 0, 100, 24, data.WareGroup);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        if (data.OrderNo.length > 9) {
            LODOP.ADD_PRINT_BARCODE(6, 125, 144, 47, "128Auto", data.OrderNo);
        }
        else {
            LODOP.ADD_PRINT_BARCODE(6, 107, 144, 47, "128Auto", data.OrderNo);
        }
        LODOP.ADD_PRINT_RECT(55, 0, 255, 60, 0, 1);
        LODOP.ADD_PRINT_TEXT(75, 2, 160, 15, "收货电话：" + data.Mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(60, 2, 150, 15, "收货人：" + data.ReceName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(89, 2, 252, 24, "收货地址：" + data.Address);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);

        if (data.Qty === 1 || data.Qty === '1') {
            LODOP.ADD_PRINT_TEXT(62, 133, 120, 20, data.BoxSerialNo);
        }
        else {
            LODOP.ADD_PRINT_TEXT(62, 133, 120, 20, "Pcs：" + data.Qty);
        }

        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        //LODOP.ADD_PRINT_BARCODE(113, 17, 80, 80, "QRCode", "https://wap.loda.com.kh/delivery");
        LODOP.ADD_PRINT_BARCODE(122, 26, 70, 70, "QRCode", "https://wap.loda.com.kh/delivery");
        // https://wap.loda.com.kh/parcel-detail?id=" + data.BoxSerialNo
        LODOP.ADD_PRINT_RECT(115, 115, 140, 73, 0, 1);
        LODOP.ADD_PRINT_TEXT(123, 120, 121, 30, data.WareKhName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        if (data.WareKhName) {
            if (data.WareKhName.length > 26) {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
            }
            else if (data.WareKhName.length > 14) {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
            }
            else {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
            }
        }
        else {
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        }

        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(155, 120, 130, 30, data.WareTel);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    },
    // 转单第三方
    TransferThirdPartyOld: function (LODOP, data) {
        //data = {OrderNo: 'P06160002',ReceName: '45545544545545',Mobile: '18208661680',CustomerCode: 'KH11720',Weight: '5',Address: 'Phnom Penh Chamkarmon 51s St Silver, Phnom Penh, Cambodia|HJASDHSADASHDKJ',};

        LODOP.ADD_PRINT_RECT(0, 0, 255, 188, 0, 1);
        LODOP.ADD_PRINT_SHAPE(4, 0, 0, 100, 55, 0, 1, "#000000");
        LODOP.ADD_PRINT_TEXT(14, -4, 110, 30, "转单第三方");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        if (data.OrderNo.length > 9) {
            LODOP.ADD_PRINT_BARCODE(6, 125, 144, 47, "128Auto", data.OrderNo);
        }
        else {
            LODOP.ADD_PRINT_BARCODE(6, 107, 144, 47, "128Auto", data.OrderNo);
        }
        LODOP.ADD_PRINT_RECT(55, 0, 255, 60, 0, 1);
        LODOP.ADD_PRINT_TEXT(75, 2, 160, 15, "收货电话：" + data.Mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(60, 2, 150, 15, "收货人：" + data.ReceName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(89, 2, 252, 24, "收货地址：" + data.Address);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);

        if (data.Qty === 1 || data.Qty === '1') {
            LODOP.ADD_PRINT_TEXT(62, 133, 120, 20, data.BoxSerialNo);
        }
        else {
            LODOP.ADD_PRINT_TEXT(62, 133, 120, 20, "Pcs：" + data.Qty);
        }
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        //LODOP.ADD_PRINT_BARCODE(113, 17, 80, 80, "QRCode", "https://wap.loda.com.kh/delivery");
        LODOP.ADD_PRINT_BARCODE(122, 26, 70, 70, "QRCode", "https://wap.loda.com.kh/delivery");
        // https://wap.loda.com.kh/parcel-detail?id=" + data.BoxSerialNo
        LODOP.ADD_PRINT_RECT(115, 115, 140, 73, 0, 1);
        LODOP.ADD_PRINT_TEXT(123, 120, 130, 30, data.CustomerCode);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        if (data.CustomerCode) {
            if (data.CustomerCode.length > 7) {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
            }
            else {
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 20);
            }
        }
        else {
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 20);
        }
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(155, 120, 130, 30, data.Weight + "KG");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    },

    // 打印直发箱子标签
    PrintBox: function (LODOP, data) {
        //data = {
        //    SerialNo: 'T25071400004', CustomerCode: '11900', OrderNo: '2312313111', FreightType: '陆运', WareGroup: '01-0',
        //    WareName: '金边', WareEnName: 'Phnom Penh', WareKhName: 'សាខាមានជ័យ - ចំការមន', WareTel: '025489875'
        //}

        LODOP.ADD_PRINT_RECT(0, 0, 255, 187, 0, 1);
        LODOP.ADD_PRINT_TEXT(0, 0, 255, 50, data.CustomerCode);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 38);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_RECT(50, 0, 255, 60, 0, 1);
        LODOP.ADD_PRINT_BARCODE(56, 7, 160, 45, "128A", data.SerialNo);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.ADD_PRINT_TEXT(65, 186, 62, 40, data.FreightType);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(114, 5, 162, 20, data.OrderNo);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_SHAPE(4, 130, 0, 130, 56, 0, 1, "#000000");
        LODOP.ADD_PRINT_TEXT(136, 1, 124, 43, data.WareGroup);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 25);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        var htmlContent = '';
        if (getUtf8ByteLength(data.WareKhName) > 20) {
            htmlContent = "<div style='font-family: KhmerOSFont;font-size: 15px;text-align:center'>" + data.WareKhName + "</div>";
        }
        else {
            htmlContent = "<div style='font-family: KhmerOSFont;font-size: 20px;text-align:center'>" + data.WareKhName + "</div>";
        }
        LODOP.ADD_PRINT_HTM(113, 110, 140, 40, htmlContent);

        //LODOP.ADD_PRINT_TEXT(115, 126, 130, 25, data.WareName);
        //LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        //LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
        //LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        //LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(140, 126, 130, 25, data.WareEnName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(164, 126, 130, 20, data.WareTel);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);


    },
    // 打印直发集包标签
    PrintCollect: function (LODOP, data) {
        //data = {
        //    CoSerialNo: 'V25082000049', Qty: '999', WareGroup: 'PP-0', WareName: '271总站',
        //    WareKhName: 'សាខាមានជ័យ - ចំការមន', WareEnName: '271Warehouse', WareTel:'025489875', StockOutOn: '2025-07-03'
        //}

        LODOP.ADD_PRINT_RECT(0, 0, 255, 187, 0, 1);
        LODOP.ADD_PRINT_RECT(0, 0, 255, 60, 0, 1);
        LODOP.ADD_PRINT_BARCODE(7, 7, 160, 45, "128A", data.CoSerialNo);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.ADD_PRINT_TEXT(10, 170, 82, 30, data.Qty + " Pcs");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(36, 171, 80, 20, data.StockOutOn);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        if (getUtf8ByteLength(data.WareKhName) > 20) {
            var htmlContent = "<div style='font-family: KhmerOSFont;font-size: 18px;text-align:center'>" + data.WareKhName + "</div>";
            LODOP.ADD_PRINT_HTM(59, 0, 255, 30, htmlContent);
        }
        else {
            var htmlContent = "<div style='font-family: KhmerOSFont;font-size: 24px;text-align:center'>" + data.WareKhName + "</div>";
            LODOP.ADD_PRINT_HTM(59, 0, 255, 30, htmlContent);
        }


        //LODOP.ADD_PRINT_TEXT(59, 0, 255, 30, data.WareName);
        //LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        //LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        //LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        //LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(82, 0, 255, 25, data.WareEnName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(105, 0, 255, 20, data.WareTel);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        
        LODOP.ADD_PRINT_SHAPE(4, 126, 0, 255, 60, 0, 1, "#000000");
        LODOP.ADD_PRINT_TEXT(135, 1, 254, 50, data.WareGroup);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 29);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    },

    printDeliverSigleBox2022: function (LODOP, data) {
        LODOP.ADD_PRINT_TEXT(84, 81, 129, 19, data.Mobile);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(103, 9, 240, 36, "Address：" + data.Address);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(65, 82, 130, 24, data.Name);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(148, 5, 95, 46, data.Qcaddress);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 9);
        LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
        LODOP.ADD_PRINT_TEXT(66, 13, 68, 20, "Receiver：");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(84, 12, 67, 20, "Mobile：");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_BARCODE(8, 156, 102, 47, "128Auto", data.OrderNo);
        LODOP.ADD_PRINT_TEXT(57, 7, 245, 9, "-----------------------------------------------");
        LODOP.ADD_PRINT_TEXT(139, 8, 238, 9, "----------------------------------------------------");
        LODOP.ADD_PRINT_LINE(53, 146, 9, 147, 0, 1);
        LODOP.ADD_PRINT_LINE(145, 111, 194, 112, 0, 1);
        LODOP.ADD_PRINT_TEXT(146, 117, 116, 19, data.Code);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(162, 116, 110, 21, data.Box);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(177, 196, 52, 25, data.Weight + "KG");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(177, 114, 87, 20, data.Size);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(64, 204, 48, 40, data.Storage);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 23);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        if (data.TarId != null && data.TarId != "") {
            LODOP.ADD_PRINT_TEXT(4, 16, 40, 30, "转");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(7, 48, 99, 26, data.PrintCn);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_TEXT(32, 5, 142, 25, data.PrintEn);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        }
        else {
            LODOP.ADD_PRINT_TEXT(43, 17, 130, 20, "www.loda.com.kh");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
            LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
            LODOP.ADD_PRINT_IMAGE(10, 15, 115, 29, "<img border='0' src='https://img.loda.cc/upload/package/log.bmp'>");
            LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
        }
    },
    // DeliveryExpressDetails.aspx
    printDeliverSigleBox2021: function (LODOP, data) {
        //LODOP.ADD_PRINT_SETUP_BKIMG("<img border='0' src='https://img.loda.cc/upload/package/log.bmp'>");
        //LODOP.SET_SHOW_MODE("BKIMG_LEFT", 8);
        //LODOP.SET_SHOW_MODE("BKIMG_TOP", 8);
        //LODOP.SET_SHOW_MODE("BKIMG_PRINT", true);
        LODOP.ADD_PRINT_TEXT(87, 81, 224, 19, data.mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(107, 9, 360, 56, "Address：" + data.address);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(65, 82, 225, 24, name);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(12, 152, 107, 46, data.qcaddress);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
        LODOP.ADD_PRINT_TEXT(66, 13, 68, 20, "Receiver：");
        LODOP.ADD_PRINT_TEXT(87, 12, 67, 20, "Mobile：");
        LODOP.ADD_PRINT_BARCODE(9, 266, 102, 47, "128Auto", data.order_no);
        LODOP.ADD_PRINT_TEXT(57, 7, 365, 9, "------------------------------------------------------------");
        LODOP.ADD_PRINT_TEXT(161, 8, 359, 9, "------------------------------------------------------------");
        LODOP.ADD_PRINT_LINE(53, 146, 9, 147, 0, 1);
        LODOP.ADD_PRINT_LINE(171, 111, 220, 112, 0, 1);
        LODOP.ADD_PRINT_TEXT(171, 115, 116, 24, data.code);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(197, 111, 125, 26, data.box);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_BARCODE(174, 9, 100, 50, "128Auto", data.order_no);
        LODOP.ADD_PRINT_TEXT(43, 16, 130, 20, "www.loda.com.kh");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_LINE(221, 234, 171, 235, 0, 1);
        LODOP.ADD_PRINT_TEXT(198, 238, 131, 25, data.weight + "KG");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(174, 239, 130, 25, data.size);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(67, 309, 62, 40, data.storage);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 26);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_IMAGE(7, 15, 125, 32, "<img border='0' src='https://img.loda.cc/upload/package/log.bmp'>");
        LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
    },
    // 在用 配送条码 （多个箱子 ） 70*50 打印配送信息 DeliveryExpressDetails.aspx
    print_orderno_no_2022: function (LODOP, data) {
        //配送明细
        LODOP.ADD_PRINT_TEXT(87, 81, 153, 19, data.mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(107, 9, 237, 40, "Address：" + data.address);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(65, 82, 156, 24, data.name);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(66, 13, 68, 20, "Receiver：");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_TEXT(87, 12, 67, 20, "Mobile：");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.ADD_PRINT_BARCODE(5, 153, 102, 47, "128Auto", data.order_no);
        LODOP.ADD_PRINT_TEXT(57, 7, 239, 9, "------------------------------------------------------------");
        LODOP.ADD_PRINT_TEXT(145, 8, 235, 9, "------------------------------------------------------------");
        LODOP.ADD_PRINT_LINE(156, 111, 199, 112, 0, 1);

        LODOP.ADD_PRINT_TEXT(154, 120, 104, 41, data.qcaddress);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(43, 19, 130, 20, "www.loda.com.kh");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(152, 9, 97, 24, "Box Count");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        //LODOP.ADD_PRINT_IMAGE(7, 15, 125, 32, "<img border='0' src='https://img.loda.cc/upload/package/log.bmp'>");
        LODOP.ADD_PRINT_IMAGE(9, 15, 120, 30, "<img border='0' src='https://img.loda.cc/upload/package/log.bmp'>");
        LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
        LODOP.ADD_PRINT_TEXT(172, 9, 100, 20, data.qty);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    },
    // 在用 配送条码 （多个箱子 ） 70*50 打印箱子明细 DeliveryExpressDetails.aspx
    print_box_noes_2022: function (LODOP, data) {
        //data = {
        //    code: 'KH123454', mobile: '475845212233', boxes: [{
        //        Code: 'D',
        //        BoxSerialNo: '231234574541',
        //        Weight: '123.54'
        //    },{
        //        Code: 'D',
        //        BoxSerialNo: '122345453254',
        //        Weight: '45.888'
        //        }]
        //}

        var arr = eval(data.boxes);
        var len = parseInt(arr.length);
        var htmlstr = "<table border=1 cellspacing=\"0\" cellpadding=\"0\" style=\"border - collapse: collapse;font-size:12px;text-align:center;width:75%;font-family:Arial,Verdana,Sans-serif;\" > ";
        //htmlstr += "<tr><td>Mobile</td><td  colspan=\"2\">" + mobile + "</td>";
        //htmlstr += "<tr><td>Code</td><td  colspan=\"2\">" + code + "</td>";
        for (var i = 0; i < len; i++) {
            //htmlstr += "<tr><td style=\"height: 18px;\">" + arr[i].Code + "</td><td style=\"height: 18px;\">" + arr[i].Weight + "</td><td style=\"height: 18px;\">" + arr[i].BoxSerialNo + "</td>";
            htmlstr += "<tr><td style='height: 18px;'>" + (i + 1) + "</td><td>" + arr[i].Weight + "</td><td>" + arr[i].BoxSerialNo + "</td>";
        }

        htmlstr += "</table>";

        //打印箱子明细
        LODOP.ADD_PRINT_HTM(35, 6, 325, "75%", htmlstr);
        LODOP.ADD_PRINT_TEXT(5, 5, 250, 33, data.code + "  " + data.mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
        LODOP.SET_PRINT_STYLEA(0, "PageUnIndex", "first");
    },

    // 在用 配送条码 （多个箱子 ） 100*60 打印配送信息 DeliveryExpressDetails.aspx
    print_orderno_no_2021: function (LODOP, data) {
        LODOP.ADD_PRINT_TEXT(87, 81, 224, 19, data.mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(107, 9, 350, 56, "Address：" + data.address);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
        LODOP.ADD_PRINT_TEXT(65, 82, 225, 24, data.name);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(66, 13, 68, 20, "Receiver：");
        LODOP.ADD_PRINT_TEXT(87, 12, 67, 20, "Mobile：");
        LODOP.ADD_PRINT_BARCODE(9, 266, 102, 47, "128Auto", data.order_no);
        LODOP.ADD_PRINT_TEXT(57, 7, 365, 9, "------------------------------------------------------------");
        LODOP.ADD_PRINT_TEXT(161, 8, 359, 9, "------------------------------------------------------------");
        //LODOP.ADD_PRINT_LINE(53, 146, 61, 147, 0, 1);
        LODOP.ADD_PRINT_LINE(171, 111, 220, 112, 0, 1);
        LODOP.ADD_PRINT_TEXT(173, 122, 105, 50, data.qcaddress);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
        LODOP.ADD_PRINT_BARCODE(174, 9, 100, 50, "128Auto", data.order_no);
        LODOP.ADD_PRINT_TEXT(43, 17, 130, 20, "www.loda.com.kh");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_LINE(221, 234, 171, 235, 0, 1);
        LODOP.ADD_PRINT_TEXT(183, 238, 131, 40, "Box Count：" + data.qty);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_IMAGE(7, 15, 125, 32, "<img border='0' src='https://img.loda.cc/upload/package/log.bmp'>");
        LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
    },
    // 在用 配送条码 （多个箱子 ） 100*60 打印箱子明细 DeliveryExpressDetails.aspx
    print_box_noes_2021: function (LODOP, data) {
        var arr = eval(data.boxes);
        var len = parseInt(arr.length);
        var htmlstr = "<table border=1 cellspacing=\"0\" cellpadding=\"0\" style=\"border - collapse: collapse;font-size:12px;text-align:center;width:75%;\" > ";
        //htmlstr += "<tr><td>Mobile</td><td  colspan=\"2\">" + mobile + "</td>";
        //htmlstr += "<tr><td>Code</td><td  colspan=\"2\">" + code + "</td>";
        for (var i = 0; i < len; i++) {
            htmlstr += "<tr><td style=\"height: 18px;\">" + arr[i].Code + "</td><td style=\"height: 18px;\">" + arr[i].BoxSerialNo + "</td><td style=\"height: 18px;\">" + arr[i].Weight + "</td>";
        }

        htmlstr += "</table>";

        LODOP.ADD_PRINT_HTM(39, 30, 304, "80.264%", htmlstr);
        LODOP.ADD_PRINT_TEXT(7, 31, 143, 33, data.code);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
        LODOP.ADD_PRINT_TEXT(8, 172, 169, 31, data.mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
    },

    // 在用 配送小票打印 DeliveryExpressDetails.aspx
    CreateNormalFormPageByLodaByNew: function (LODOP, data) {

        //data = {
        //    orderNo:'P2508134919',
        //    mobile: '015453655',
        //    code: 'KH1193591',
        //    address: 'Phnom Penh ChamkarmonGWXP+ W48, Phnom Penh, Cambodia黄山大厦1楼大厅',
        //    qcaddress: 'gfssimgginisnislmg',
        //    ReceiveName:'中国',
        //    boxes: [{
        //        Serail: 'Z25080704318',
        //        CN2THFreightAmount: '452.21',
        //        PostalCode: '10*10*10',
        //        AbroadWeight:'2145.21'
        //    }]
        //}

        var arr = eval(data.boxes);
        var len = parseInt(arr.length);

        //PMingLiU  SimSun
        //var htmlstr = "<table style=\"font-size:12px;text-align:center;font-family:\"Consolas\", \"Courier New\", monospace;font-weight:800;\"    > ";
        //for (var i = 0; i < len; i++) {
        //    var index = i + 1;
        //    htmlstr += "<tr style=\"border-bottom:1px solid #000000;\"><td >&nbsp;&nbsp;" + index + "</td><td>&nbsp;&nbsp;" + arr[i].Serail + "</td><td >&nbsp;&nbsp;" + arr[i].CN2THFreightAmount + "</td></tr>";
        //    htmlstr += "<tr><td colspan=\"2\">（" + arr[i].PostalCode + "&nbsp;&nbsp;&nbsp;&nbsp;" + arr[i].AbroadWeight + "）</td></tr>";
        //}

        //htmlstr += "</table>";

        LODOP.ADD_PRINT_TEXT(12, 12, 178, 30, "Delivery ");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        if (data.orderNo.length > 10) {
            LODOP.ADD_PRINT_BARCODE(49, 13, 159, 64, "128Auto", data.orderNo);
        }
        else {
            LODOP.ADD_PRINT_BARCODE(49, 20, 149, 64, "128Auto", data.orderNo);
        }
        LODOP.ADD_PRINT_LINE(119, 2, 120, 186, 0, 1);

        LODOP.ADD_PRINT_TEXT(122, 15, 161, 35, data.code);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 19);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(153, 15, 166, 35, data.mobile);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 18);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(191, 15, 166, 28, data.ReceiveName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(217, 15, 173, 80, data.address + data.qcaddress);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_LINE(301, 4, 300, 188, 0, 1);

        //LODOP.ADD_PRINT_HTM("81mm", "2%", "52.1mm", "1993.387%", htmlstr);

        var currentY = 305; // 初始Y坐标
        var pageHeight = 1140; // 纸高度（毫米）
        for (var i = 0; i < len; i++) {
            var index = i + 1;
            // 检查是否需要分页（每项高度40，加上间距）
            if (currentY + 40 > pageHeight) {
                LODOP.NewPage();
                currentY = 5; // 重置到新页的起始位置
            }
            LODOP.ADD_PRINT_TEXT(currentY, 6, 174, 20, index + "  " + arr[i].Serail + "  " + arr[i].CN2THFreightAmount);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "Arial");
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.ADD_PRINT_TEXT(currentY + 20, 5, 172, 20, "（" + arr[i].PostalCode + "   " + arr[i].AbroadWeight + "）");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "Arial");
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            currentY += 40;
        }
    },

    // 在用 小票打印 DeliveryExpressDetails.aspx
    PrintPickUpByQc: function (LODOP, data) {
        var arr = eval(data.boxes);
        var len = parseInt(arr.length);

        var customer = "";
        var name = "";

        if (len > 0) {
            customer = arr[0].CustomerCode;
            name = arr[0].CustomerName;
        }

        //PMingLiU  SimSun
        //var htmlstr = "<table style=\"font-size:12px;text-align:center;font-family:Arial,Verdana,Sans-serif;font-weight:100\">";

        //for (var i = 0; i < len; i++) {
        //    htmlstr += "<tr><td >" + arr[i].FreightCode + "&nbsp;&nbsp;" + "</td><td >" + arr[i].Serail + "&nbsp;&nbsp;" + "</td><td >" + arr[i].StorageCode + "&nbsp;&nbsp;" + "</td > <td >" + arr[i].CN2THFreightAmount + "</td></tr > ";
        //    htmlstr += "<tr><td colspan=\"4\">（" + arr[i].PostalCode + "&nbsp;&nbsp;&nbsp;&nbsp;" + arr[i].AbroadWeight + "）</td></tr>";
        //    if (customer == "") {
        //        customer = arr[i].CustomerCode;
        //    }
        //    if (name == "") {
        //        name = arr[i].CustomerName;
        //    }
        //}
        //htmlstr += "</table>";

        //LODOP.PRINT_INITA(-10, -12, 197, 720, "");
        //LODOP.SET_PRINT_PAGESIZE(3, 520, 0, "CreateCustomPage");

        //LODOP.ADD_PRINT_HTM("22.41mm", "4.55%", "55.01mm", "689.967%", htmlstr);
        LODOP.ADD_PRINT_TEXT(51, 12, 90, 25, name);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(48, 100, 92, 25, customer);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(20, 18, 164, 27, data.orderNo);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);


        var currentY = 80; // 初始Y坐标
        var pageHeight = 1140; // 纸高度（毫米）
        for (var i = 0; i < len; i++) {
            // 检查是否需要分页（每项高度40，加上间距）
            if (currentY + 40 > pageHeight) {
                LODOP.NewPage();
                currentY = 5; // 重置到新页的起始位置
            }
            LODOP.ADD_PRINT_TEXT(currentY, 6, 174, 20, arr[i].FreightCode + " " + arr[i].Serail + " " + arr[i].StorageCode + " " + arr[i].CN2THFreightAmount);
            LODOP.SET_PRINT_STYLEA(0, "FontName", "Arial");
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            LODOP.ADD_PRINT_TEXT(currentY + 20, 5, 172, 20, "（" + arr[i].PostalCode + "   " + arr[i].AbroadWeight + "）");
            LODOP.SET_PRINT_STYLEA(0, "FontName", "Arial");
            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
            currentY += 40;
        }
    },
    // 小票打印 在用 客户联 DeliveryExpressDetails.aspx
    PrintPickUpByCustomer: function (LODOP, data) {
        //LODOP.PRINT_INITA(0, 0, 197, 289, "");
        LODOP.SET_PRINT_PAGESIZE(3, 520, 0, "CreateCustomPage");
        LODOP.ADD_PRINT_TEXT(100, 3, 179, 35, data.code);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(7, 30, 140, 30, "Picking Order");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(148, 5, 178, 20, "Picker");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(174, 6, 179, 40, data.picker);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(67, 0, 180, 37, "No." + data.number);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(215, 3, 177, 36, data.orderNo);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(44, 0, 180, 20, "- - - - - - - - - -");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
    },
    // DeliveryExpressDetails.aspx
    PrictZhuanOrderNew: function (LODOP, data) {
        LODOP.ADD_PRINT_TEXT(78, 42, 217, 58, data.cn_name);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 28);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(134, 11, 248, 50, data.en_name);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 21);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_BARCODE(17, 48, 151, 51, "128Auto", data.order_no);
        LODOP.ADD_PRINT_TEXT(81, 20, 43, 39, "转");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 25);
        LODOP.ADD_PRINT_ELLIPSE(75, 8, 60, 49, 0, 1);
    },

    // InternationalPackageEnterNew.aspx、InternationalPackageBoxList.aspx
    PrintBox2022New: function (LODOP, data) {
        //(serialNo, customerCode, orderNo, printName, enprintName, FreightType, ware_group)
        LODOP.ADD_PRINT_BARCODE(62, 13, 161, 45, "128A", data.SerialNo);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.ADD_PRINT_TEXT(66, 201, 62, 30, data.FreightType);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(115, 9, 162, 25, data.OrderNo);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(147, 131, 134, 43, data.WareEnName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(114, 129, 134, 32, data.WareName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(3, 24, 229, 51, data.CustomerCode);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 38);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(136, 9, 124, 50, data.WareGroup);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 25);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    },
    // InternationalPackageEnterNew.aspx、InternationalPackageBoxList.aspx
    PrintCollectBy2019: function (LODOP, data) {
        LODOP.ADD_PRINT_TEXT(85, 15, 231, 36, data.WareName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(51, 182, 83, 28, data.StockOutOn);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(17, 181, 67, 33, data.Qty);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_BARCODE(14, 22, 159, 62, "128A", data.CoSerialNo);
        LODOP.ADD_PRINT_TEXT(114, 17, 229, 40, data.WareEnName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(144, 18, 225, 46, data.WareGroup);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 30);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(27, 233, 28, 20, "Pcs");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
    },

    // 中转详情的热敏打印 SignBox/TransferLoadCar.aspx
    PrintTicketDetail: function (LODOP, data) {

        //data = {
        //    SerialNo: 'L2508220572',
        //    WarehouseKhName: 'សាខាមានជ័យ - ចំការមន',
        //    Code: 'LC-369',
        //    Sort: '123',
        //    TotalNum: '999',
        //    PrintDate: '2025-08-22',
        //    WarehouseEnName: '271Warehouse',
        //    Tel: '0712008484',
        //    Remark:'2131232131'
        //}

        LODOP.ADD_PRINT_RECT(7, 1, 244, 171, 0, 1);
        LODOP.ADD_PRINT_RECT(54, 1, 244, 44, 0, 1);
        LODOP.ADD_PRINT_SHAPE(4, 7, 170, 75, 47, 0, 1, "#000000");

        LODOP.ADD_PRINT_BARCODE(11, 7, 158, 38, "128B", data.SerialNo);

        var htmlContent = "<div style='font-family: KhmerOSFont;font-size: 20px;text-align:center'>" + data.WarehouseKhName + "</div>";
        LODOP.ADD_PRINT_HTM(60, 7, 234, 36, htmlContent);

        //LODOP.ADD_PRINT_TEXT(60, 7, 234, 36, data.WarehouseKhName);
        //LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        //LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        //LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(14, 173, 71, 36, data.Code);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_RECT(98, 170, 75, 58, 0, 1);
        LODOP.ADD_PRINT_RECT(156, 1, 244, 22, 0, 1);

        LODOP.ADD_PRINT_TEXT(112, 163, 90, 37, data.Sort + '/' + data.TotalNum);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(158, 10, 227, 20, data.PrintDate);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_RECT(116, 1, 70, 20, 0, 1);
        LODOP.ADD_PRINT_RECT(116, 71, 99, 20, 0, 1);
        
        LODOP.ADD_PRINT_TEXT(101, 5, 230, 20, data.WarehouseEnName);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(118, 6, 62, 20, "联系电话");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(120, 72, 100, 20, data.Tel);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        //LODOP.ADD_PRINT_TEXT(139, 6, 62, 20, "中转单号");
        //LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        //LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        //LODOP.ADD_PRINT_RECT(136, 71, 99, 20, 0, 1);
        //LODOP.ADD_PRINT_TEXT(138, 60, 120, 20, data.SerialNo);
        //LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        //LODOP.SET_PRINT_STYLEA(0, "Bold", 1);


        LODOP.ADD_PRINT_RECT(136, 1, 169, 20, 0, 1);
        LODOP.ADD_PRINT_TEXT(139, 3, 161, 20, data.Remark);
        if (getUtf8ByteLength(data.Remark) > 20) {
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 5);
        }
        else {
            LODOP.SET_PRINT_STYLEA(0, "FontSize", 8);
        }
        
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    },

    // 中转详情的小票打印 SignBox/TransferLoadCar.aspx
    PrintTicket: function (LODOP, data) {

        LODOP.ADD_PRINT_TEXT(18, 20, 165, 25, data.StockOutOn); //日期
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(265, 31, 68, 31, "集包");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(198, 11, 176, 35, data.WareHouseName); // 仓库中文名称
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 18);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(265, 113, 68, 31, parseInt(data.CoCount) + parseInt(data.HeBaoCount)); // 集包值
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(430, 114, 68, 31, (parseInt(data.CoCount) + parseInt(data.HeBaoCount)) + parseInt(data.ReCount) + (parseInt(data.BenTuCount) + parseInt(data.BenTuDuoCount)) + (parseInt(data.PickCount) + parseInt(data.BoxCount))); // 合计值
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 19);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(129, 12, 172, 20, data.SerialNo); // 中转单号
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_BARCODE(63, 11, 190, 60, "128B", data.SerialNo); //中转单号二维码
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 0);
        LODOP.SET_PRINT_STYLEA(0, "ShowBarText", 0);
        LODOP.ADD_PRINT_SHAPE(4, 155, 9, 190, 39, 0, 1, "#000000");

        LODOP.ADD_PRINT_TEXT(160, 13, 179, 30, data.Code); //仓库Code
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 18);
        LODOP.SET_PRINT_STYLEA(0, "FontColor", "#FFFFFF");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(427, 22, 88, 34, "合计");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 21);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(296, 31, 68, 31, "单件");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(295, 113, 68, 31, parseInt(data.PickCount) + parseInt(data.BoxCount) - parseInt(data.KongYunCount)); // 单件值
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(325, 31, 68, 31, "物流");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(325, 113, 68, 31, data.ReCount); // 物流值
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(354, 31, 68, 31, "空运");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(352, 113, 68, 31, data.KongYunCount); // 空运值
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(382, 30, 68, 31, "本土");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(382, 113, 68, 31, parseInt(data.BenTuCount) + parseInt(data.BenTuDuoCount)); // 本土值
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(467, 29, 68, 31, "重量");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(467, 82, 105, 30, data.TotalWeight); // 重量值
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(498, 29, 68, 31, "体积");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(497, 82, 105, 30, data.TotalVolume); // 体积值
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(42, 20, 167, 20, data.OpName); // 操作用户
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(255, 5, 195, 20, "  - - - - - - - - - - - - - - - ");

        LODOP.ADD_PRINT_TEXT(228, 7, 195, 35, data.WarehouseEnName); // 仓库英文名称
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);

        LODOP.ADD_PRINT_TEXT(406, 3, 196, 20, "  - - - - - - - - - - - - - - - ");


        //LODOP.SET_PRINTER_INDEXA("outPrinterAB58GK");

    },
    // 中转详情的转单打印 SignBox/TransferLoadCar.aspx
    PrintZhuanDetail: function (LODOP, data) {

        LODOP.ADD_PRINT_TEXT(26, 7, 173, 36, data.Size + "交接单");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(61, 7, 57, 20, "流水号");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
        LODOP.ADD_PRINT_TEXT(57, 67, 125, 31, data.SerialNo);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(85, 8, 57, 20, "车牌号");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
        LODOP.ADD_PRINT_TEXT(83, 67, 123, 25, data.CardNo);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.ADD_PRINT_TEXT(108, 7, 59, 20, "发车时间");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
        LODOP.ADD_PRINT_TEXT(105, 67, 121, 25, data.StockOutOn);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.ADD_PRINT_TEXT(143, 5, 166, 20, "目标站");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(164, 4, 171, 25, data.Warehouse);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_LINE(139, 3, 138, 188, 0, 1);
        LODOP.ADD_PRINT_TEXT(201, 18, 63, 20, "集包件");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(223, 18, 64, 20, "独包件");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(250, 18, 65, 20, "箱子件");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(272, 19, 65, 20, "转仓件");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(202, 88, 83, 20, data.CoCount);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(224, 88, 84, 20, data.ReCount);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(249, 88, 82, 20, data.BoxCount);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(274, 88, 81, 20, data.PickCount);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_LINE(430, 12, 429, 183, 0, 1);
        LODOP.ADD_PRINT_TEXT(304, 35, 52, 20, "合计");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 3);
        LODOP.ADD_PRINT_TEXT(295, 84, 87, 30, data.TotalCount);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 20);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(336, 18, 64, 20, "物流件");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(335, 86, 89, 20, data.VolCount);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(433, 37, 100, 20, "备注");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(531, 40, 100, 20, "");
        LODOP.ADD_PRINT_LINE(541, 11, 542, 189, 0, 1);
        LODOP.ADD_PRINT_TEXT(369, 18, 62, 20, "重量");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(400, 19, 60, 20, "体积");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);

        LODOP.ADD_PRINT_TEXT(369, 85, 90, 20, data.Weight);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(401, 86, 90, 20, data.Wolume);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
    },
    // 小票打印 在用 客户联 AbroadPickUpBySelf.aspx
    PrintPickUpByCustomerNew: function (LODOP, data) {

        //data = {
        //    CustomerName: '',
        //    CustomerCode: '',
        //    OrderNo: '',
        //    BoxCount: '',
        //    StorageCode: '',
        //    IsAdvance: ''
        //}

        var orderName = "Pre-Order"
        if (data.IsAdvance = "0") {
            orderName = "Picking Order"
        }

        LODOP.ADD_PRINT_TEXT(97, 23, 121, 25, data.CustomerName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(63, 24, 158, 30, data.CustomerCode);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(124, 21, 164, 32, data.OrderNo);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(158, 21, 164, 37, "Box Count：" + data.BoxCount);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(29, 20, 171, 31, orderName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(94, 149, 33, 31, data.StorageCode);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 16);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    },

    // 无主标签打印
    PrintUnclaimedBox: function (LODOP, data) {
        //data = {
        //    BoxNo: '',
        //    ExpressNo: '',
        //    CustomerCode: '',
        //    Size: '',
        //    Weight: '',
        //}
        LODOP.ADD_PRINT_TEXT(10, 6, 257, 43, data.BoxNo);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 26);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(52, 7, 252, 32, data.ExpressNo);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 17);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.ADD_PRINT_TEXT(111, 7, 247, 73, data.CustomerCode);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 46);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(88, 9, 148, 25, data.Size);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT(88, 159, 100, 25, data.Weight + "KG");
        LODOP.SET_PRINT_STYLEA(0, "FontName", "等线");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
    },
};

function getUtf8ByteLength(str) {
    var len = 0;
    for (var i = 0; i < str.length; i++) {
        var code = str.charCodeAt(i);
        if (code <= 0x7f) {
            len += 1;  // ASCII
        } else {
            len += 2;  // 2字节字符（如中文）
        }
    }
    return len;
}