Automation with BarTender XML Script

Required Edition

Automation, Enterprise Automation

BarTender XML Script (BTXML Script) provides the ability to easily automate BarTender while allowing third-party programmers a simple way to integrate BarTender into their applications.

In some cases, an XML response is created after running the script. An example of this is when you pass BTXML Script to BarTender by using ActiveX Automation. An XML response will provide you with valuable information about the print job, the printer used to complete the job, BarTender's settings during the print job, and complete details about the printed items. This response can be integrated with a custom application. An XML response is returned when BTXML script is run using the following methods:

For more information, refer to Using the XML Response.

You can execute BTXML Script using any of the following methods:

ClosedCommand Line Interface

BarTender's functions can be performed automatically, when BarTender starts, by passing BTXML Script via the command line. The BTXML Script must be passed as a string or a file, and the /XMLScript parameter must be the last argument on the command line.

The following example defines the correct structure for passing a BTXML Script string to BarTender for processing (where btxml_script is the BarTender XML code to execute):

/XMLScript="btxml_script"

The following example defines the correct structure for passing a BTXML Script file to BarTender for processing (where btxml_file is the path and file name of the file containing the BarTender XML code to execute):

/XMLScript="btxml_file"

For more information on using the command line, see the Command Line Parameter Reference.

BTXML Scripts executed through the command line do not return or save an XML response.

ClosedBarTender File Menu

You can execute BTXML Script files within BarTender by selecting Run BTXML Script from the File menu and navigating to the saved BTXML Script file.

BTXML Scripts executed through the File menu do not return or save an XML response.

ClosedActiveX Automation

Using a programming or scripting language, such as Visual Basic or C#, you can pass BTXML scripts to BarTender using ActiveX Automation. This is done by using the Application object's XMLScript method.

For more information about automating BarTender with ActiveX Automation and using the Application object, see Automation with ActiveX and Using the Application Object, respectively.

BTXML Scripts executed using ActiveX Automation do return an XML response.

ClosedPrint Server API

The Print Server API allows you to execute BTXML Script through the XMLScriptTask class, available for use in both C# and VB.NET. For more information, please see BarTender's .NET SDK documentation.

BTXML Scripts executed using the Print Server API do return an XML response.

ClosedIntegration Builder Integration Files

Using Integration Builder, you can create an integration file containing a Print BTXML Script action that you can configure to pass your BTXML Script to BarTender to print one or more documents.

For more information about creating integration files, refer to the Integration Builder help system.

BTXML Scripts executed using a Print BTXML Script action do return an XML response.

In This Section