Using the XML Response |
In some cases, an XML response is created after the script runs. An XML response gives you valuable information about the print job, including the printer that was used, the BarTender settings, and complete details about the printed items. This response can be integrated with a custom application.
An XML response is returned when you run BTXML script by using the following methods:
Integration Builder integration files
Print Server API
ActiveX Automation
You can use the information that is contained in the response to do the following:
Troubleshoot problems that were encountered while print jobs were processed.
Record the status of print jobs.
Create a record that you can use to validate the content of documents and individual printed items.
Create a summary of the entire print job.
The default response that is returned contains information about the user who sent the BTXML request, the printer that was used to process the request, the status of the print job, and any messages that were created. The following example shows the response that is returned when no attributes are used or when the ReturnPrintData attribute is set to true and the ReturnSummary and ReturnLabelData attributes are set to false.
<?xml version="1.0" encoding="utf-16"?>
<Response Version="2.0" Name="09232006_103601_Job1" ID="123" AppName="BarTender" AppVersion="9.00" AppVersionId="900" AppVersionMajor="9" AppVersionMinor="00" AppVersionBuild="2345" AppInstancePid="12345" AppInstanceGUID="(5EFC7975-14BC-11CF-9B2B-00AA00573819)">
<User>Administrator</User>
<Server>MyServer</Server>
<Command Name="Job1">
<Print GUID="{C87068F8-4972-41F1-A6E8-724381703764}" JobName="MCIJob" ID="1234" JobLastStatus="Sent" JobCompleted="true">
<JobStatus Completed="true">
<TimeJobStart>02:24:34</TimeJobStart>
<TimeJobQueued>02:24:34</TimeJobQueued>
<TimeJobSent>02:24:34</TimeJobSent>
<LastStatus>Sent</LastStatus>
<Description>Finished sending print job to printer.</Description>
</JobStatus>
<Message ID="1606" GUID="{8A8E8550-C822-4e84-8713-212793DFD6E1}" Severity="Information" Category="Miscellaneous" Response="OK">
<Text>BarTender successfully sent the print job to the spooler.
Job Name: MyJobName
BarTender Document: Document1.btw
Printer: Datamax H-4212 7.1.4 </Text>
</Message>
</Print>
</Command>
</Response>
You can configure the response to include additional information by setting the attributes that are associated with the following commands:
<Print> command attributes: ReturnPrintData, ReturnSummary, ReturnLabelData, and ReturnChecksum.
<ExportPrintPreviewToImage> command attribute: ReturnImageInReponse.
The following sections describe how to use these attributes to affect the information that the response returns.
Returning Print Data in the Response
Provides an example of the response that is returned when the ReturnPrintData attribute is set to true and no other attributes are set or when the ReturnSummary, ReturnLabelData and ReturnChecksum attributes are included and are set to true.
Returning Summary Data in the Response
Provides an example of the response that is returned when the ReturnSummary attribute is set to true and the ReturnLabelData attribute is set to false.
Returning Template Data in the Response
Provides an example of the response that is returned when the ReturnLabelData attribute is set to true and the ReturnSummary attribute is set to false.
Returning Checksum Data in the Response
Provides an example of the response that is returned when the ReturnChecksum attribute is set to true.
Returning an Exported Template in a Response
Provides an example of the response that is returned when the ReturnImageInResponse attribute is set to true.
Related Topics