ExportPrintPreviewToImage Response Tag

ClosedDescription

Each time an <ExportPrintPreviewToImage> command is passed to BarTender an XML response is generated. If the ReturnImageInResponse attribute is set to false, the response contains user, server and command information followed by the <ExportPrintPreviewToImage> command as an empty element tag: <ExportPrintPreviewToImage/>. The closing tags for command and the response follow. The example below illustrates a response:

<?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>Server</Server>

<Command Name="Job1">

<ExportPrintPreviewToImage/>

</Command>

</Response>

If the ReturnImageInResponse attribute is set to true, the response will contain all of the image data in Base 64 format. The example below illustrates a response containing the image data in Base 64 format.

<?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">

<ExportPrintPreviewToImage>

<ImageData ImageFormatType="jpg" Page="1"/9j/4AAQSkZJRgABAAEBLAEsAAD//gAfTEVBRCBUZWNobm9s

b2dpZXMgSW5jLiBWMS4wMQD/2wBDAAICAgICAgICAgICAgIC

AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC

AgICAgICAgICAgICAgL/xAGiA...

                      ...AUAFABQAUAFABQAUAFAB

QAUAFABQAUAFABQAUAFABQAUAFABQAUAFAH/2Q==</ImageData>

</ExportPrintPreviewToImage>

</Command>

</Response>

The previous example illustrates the size of responses that contain the image data in Base64 format. The example contains the response for a document that printed 6 items with 6 text fields on each template. The majority of the Base64 data code was removed from the above example because the purpose was to demonstrate the structure of the file, not to show the entire content of the response. The entire response was a 64KB file that included 1245 lines of code when saved as a .txt file. The example does serve to remind users of the size of Base64 files and the space necessary to store such files.

ClosedParent Tag

<Command> Response

ClosedRequirements

BTXML Script version 2.0 (BarTender 9.0 and higher)

Related Topics