简体   繁体   中英

Can't figure out how to pass copies to DYMO.Label.Framework.3.0.js SDK

I have been searching the internet for three weeks and have been waiting 10 days for Dymo engineering to answer my question about setting the number of copies that are to be printed.

Here is my post: http://developers.dymo.com/2018/05/29/updated-js-sdk-and-dls/#comment-85589

I received one reply from the engineering staff and was told to go to this page. http://labelwriter.com/software/dls/sdk/docs/DYMOLabelFrameworkJavaScriptHelp/symbols/dymo.label.framework.ILabel.html#print

All of my questions were to be answered by this page. HA!

On the page, there is this entry. {string} printParamsXml The print parameters, such as the number of copies, print quality, etc. See PrintParams.xsd. http://labelwriter.com/software/dls/sdk/PrintParams.xsd

To me, this is just an XML page. It does not tell me how to pass the information needed to

w("dymo.label.framework.createTapePrintParamsXml",function(a){if(!a)return"";var b=R("<TapePrintParams/>"),d=b.documentElement;a.copies&&S(d,"Copies",a.copies.toString());a.jobTitle&&S(d,"JobTitle",a.jobTitle);a.flowDirection&&S(d,"FlowDirection",a.flowDirection);a.alignment&&S(d,"Alignment",a.alignment);a.cutMode&&S(d,"CutMode",a.cutMode);return ie(b)});

Which is inside http://labelwriter.com/software/dls/sdk/js/DYMO.Label.Framework.3.0.js .

I am calling the function on line 402 of https://github.com/juggernautsei/dymo-print-logic/blob/juggernautsei-patch-3/PrintMeThatLabel.js

But when I print, there is only one label printed. I have to back up and let you know what else I found.

http://labelwriter.com/software/dls/sdk/docs/DYMOLabelFrameworkJavaScriptHelp/symbols/dymo.label.framework.html#.printLabel

dymo.label.framework.printLabel(printerName, printParamsXml, labelXml, labelSetXml) Prints one or more labels.

I have set the code to this.

            var labelSet = new dymo.label.framework.LabelSetBuilder();
            var params = dymo.label.framework.createLabelWriterPrintParamsXml({Copies:copies});

            labelSet.addRecord().setText(objName, text);


            // print
            //label.print(printer.name, null, labelSet.toString());
            // print and get status
            var printJob = label.printAndPollStatus(printer.name, params.copies, labelSet.toString(), function(printJob, printJobStatus)
            {

I still on get one label. Seems like I have all the pieces of the puzzle but can't complete the picture. HELP...please.

var params = dymo.label.framework.createLabelWriterPrintParamsXml({copies:2,twinTurboRoll:'Right',printQuality:'Text'});                
//now params contains <LabelWriterPrintParams><Copies>2</Copies><PrintQuality>Text</PrintQuality><TwinTurboRoll>Right</TwinTurboRoll></LabelWriterPrintParams>
var printJob = label.printAndPollStatus(printer.name, params, labelSet.toString(), function(printJob, printJobStatus)
{
    // output status
    var statusStr = 'Job Status: ' + printJobStatus.statusMessage;

    var result = (printJobStatus.status != dymo.label.framework.PrintJobStatus.ProcessingError 
    && printJobStatus.status != dymo.label.framework.PrintJobStatus.Finished);

    // reenable when the job is done (either success or fail)
    printButton.disabled = result;

    //if (!result)
    //    statusStr = '';

    setTextContent(jobStatusMessageSpan, statusStr);

    return result;

}, 1000);

It works very well with the DYMO labelWriter Wireless printer

如何进行批量打印?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM