我已经在互联网上搜索了三个星期,并且已经等了10天以进行Dymo工程设计,以回答有关设置打印份数的问题。
这是我的帖子:
http://developers.dymo.com/2018/05/29/updated-js-sdk-and-dls/#comment-85589
我收到了工程人员的一封回复,并被告知转到此页面。
http://labelwriter.com/software/dls/sdk/docs/DYMOLabelFrameworkJavaScriptHelp/symbols/dymo.label.framework.ILabel.html#print
此页面将回答我的所有问题。哈!
在页面上,有此条目。
{string} printParamsXml
打印参数,例如份数,打印质量等。请参见PrintParams.xsd。 http://labelwriter.com/software/dls/sdk/PrintParams.xsd
对我来说,这只是一个XML页面。它没有告诉我如何将所需的信息传递给
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)});
在http://labelwriter.com/software/dls/sdk/js/DYMO.Label.Framework.3.0.js内部。
我正在调用第402行的函数
https://github.com/juggernautsei/dymo-print-logic/blob/juggernautsei-patch-3/PrintMeThatLabel.js
但是当我打印时,只打印了一个标签。我必须备份,并让您知道我还发现了什么。
http://labelwriter.com/software/dls/sdk/docs/DYMOLabelFrameworkJavaScriptHelp/symbols/dymo.label.framework.html#.printLabel
dymo.label.framework.printLabel(printerName,printParamsXml,labelXml,labelSetXml)
打印一个或多个标签。
我已经将代码设置为此。
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)
{
我仍然得到一个标签。似乎我掌握了所有难题,但无法完成所有工作。请帮助。
最佳答案
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);
与DYMO labelWriter无线打印机配合使用效果很好
关于javascript - 无法弄清楚如何将副本传递到DYMO.Label.Framework.3.0.js SDK,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54826734/