BXML no longer works with Bartender 2022
We've been using Bartender 2019 with the .NET SDK sending print requests using BXML. We tried to upgrade to BT 2022 and the same BXML call is erroring out because an extra element "SouceEngineIdList" is being added to the call. Here is my C# code:
var filePath = request.FilePath;
var basePath = Config.AppSettings["LabelBasePath"];
var labelPath = Path.Combine(basePath, filePath);
var substrings = string.Empty;
if(request.Substrings != null)
{
foreach (var s in request.Substrings)
{
substrings += $"<NamedSubString Name=\"{s.Key}\"><Value>{s.Value}</Value></NamedSubString>";
}
}
string xmlScript = $@"<?xml version='1.0' encoding='utf-8'?>
<XMLScript Version='2.0'>
<Command>
<Print WaitForJobToComplete='true' JobName='{request.JobName}'
Timeout='30000' ReturnPrintData='true' ReturnSummary='true'
ReturnLabelData='true' ReturnChecksum='true'>
<Format>{labelPath}</Format>
{substrings}
<PrintSetup>
<Printer>{request.Printer}</Printer>
<IdenticalCopiesOfLabel>{request.Quantity}</IdenticalCopiesOfLabel>
<EnablePrompting>false</EnablePrompting>
</PrintSetup>
</Print>
</Command>
</XMLScript>";
XMLScriptTask task = new XMLScriptTask(xmlScript, XMLSourceType.ScriptString);
btTaskManager.TaskQueue.QueueTaskAndWait(task, 60000);
return task.XMLResponse;
This worked fine with BT 2019, but is now returning an error in BT 2022:
An error occurred during BTXML Script processing: The attribute 'SourceEngineIdList' on the element 'Print' is not defined in the DTD/Schema.
<?xml version='1.0' encoding='utf-16'?>
<XMLScript Version='2.0'>
<Command>
<Print WaitForJobToComplete='true' JobName='LabelGenApp - Part Numbers - EACH' Timeout='30000' ReturnPrintData='true' ReturnSummary='true' ReturnLabelData='true' ReturnChecksum='true' SourceEngineIdList='2172'>
<Format>\\\\mlbartender\\bartenderlabels$\\Part Numbers - EACH.btw</Format>
<NamedSubString Name='invtID'>
<Value>3030-BL</Value>
</NamedSubString>
<PrintSetup>
<Printer>ITROOMLABELPRINTERZEBRA</Printer>
<IdenticalCopiesOfLabel>1</IdenticalCopiesOfLabel>
<EnablePrompting>false</EnablePrompting>
</PrintSetup>
</Print>
</Command>
</XMLScript>
-
Asif Chaudhry
★ BarTender Hero ★
This error also occured while printing via SDK (Bartender 2022)
Please Bartender team take a look in TaskMaster(C#) example provided in SDK.
0 -
Jonathan DuPen
★ BarTender Hero ★
Any updates on this? Is there a fix planned in the near future or should we start looking for an alternative printing tool?
0
請登入寫評論。
評論
2 條評論