Open topic with navigation
Automation with BarTender XML Script
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:
Print Server API
Integration Builder Integration Files
For more information, refer to Using the XML Response.
You can execute BTXML Script using any of the following methods:
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):
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):
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.
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.
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.
BTXML Scripts executed using ActiveX Automation do return an XML response.
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.
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.
BTXML Scripts executed using a Print BTXML Script action do return an XML response.
An introduction to common tasks that you can accomplish with BTXML Scripts.
Refer to the Help system Table of Contents in this section for listings of the BTXML Script Message commands and tags and the BTXML Script Response tags.