Zebra Zebra Virtual PrintWare PrintManager Virtual Printware Suite Programmer's Reference Manual

PrintManager™
P1057447-002
Virtual PrintWare Suite™
Programmer’s Reference Manual
Copyright Notice
© 2015 ZIH Corp.
This document contains information proprietary to Zebra Technologies Corporation. This document and the information contained within is Copyrighted by Zebra Technologies Corporation and may not be duplicated in full or in part by any person without written approval from Zebra.
While every effort has been made to keep the information contained within current and accurate as of the date of publication, no guarantee is given that the document
is error-free or that it is accurate with regard to any specication. Zebra Technologies
Corporation reserves the right to make changes, for the purpose of product improvement, at any time.
Trademarks
Zebra is a registered trademark and Virtual PrintWare is a trademark of Zebra Technologies Corporation. Windows is a registered trademark of Microsoft Corporation in the United States and other countries. All other trademarks or registered trademarks are marks of their respective holders.
Contents
Introduction .....................................................................................................................1
Purpose ..................................................................................................................................................1
PrintManager Overview .........................................................................................................................2
PrintManager Data ................................................................................................................................. 3
Print Job Processing .............................................................................................................................. 4
Template-Based Printing ........................................................................................................................ 5
Sample Template ...................................................................................................................................6
Sample Data Document ..................................................................................................................6
SDK-Based Printing ............................................................................................................................... 7
PrintManager Programming Interface ..........................................................................9
Introduction ............................................................................................................................................9
Template Printing ................................................................................................................................10
Template Document ............................................................................................................................. 11
Tag Descriptions ............................................................................................................................ 12
Job Document ...................................................................................................................................... 18
Sample Job Document ..................................................................................................................18
Data Document .................................................................................................................................... 19
XML Data Document ....................................................................................................................19
CSV Data Document ....................................................................................................................20
ZXP Card Interface ..............................................................................................................................22
ZXP Card Interface Command Syntax ..........................................................................................22
Store Command ...........................................................................................................................23
Delete Command ..........................................................................................................................25
Submit Command ......................................................................................................................... 26
Request Command ........................................................................................................................28
P1057447-002 PrintManager Programmer's Reference Manual i
Sending Document to PrintManager .................................................................................................... 32
Open a TCP/IP Connection ...........................................................................................................32
Send a Document .......................................................................................................................... 32
Receive PrintManager’s Response ............................................................................................... 33
Parse the Received Response ...................................................................................................... 34
Close a TCP/IP Connection ........................................................................................................... 35
Sending ZMotif-Based Jobs to PrintManager ......................................................................................36
Open a TCP/IP Connection ...........................................................................................................36
Build a print job .............................................................................................................................. 36
Send a print job .............................................................................................................................37
Receive PrintManager’s Response ............................................................................................... 37
Close a TCP/IP Connection ........................................................................................................... 37
Worldwide Support ....................................................................................................... 39
ii PrintManager Programmer's Reference Manual P1057447-002
Purpose
1
Introduction
The purpose of this manual is to dene and describe the PrintManager application
programming interface (API). The PrintManager API supports two methodologies for interfacing to an application: Message-based printing and SDK-based printing; both methods require communication via TCP/IP or via drag-and-drop from a hot-drop folder.
P1057447-002 PrintManager Programmer's Reference Manual 1
Introduction
PrintManager Overview
PrintManager Overview
PrintManager is a service that runs on Microsoft Windows operating systems. PrintManager can process ZMotif-based and message-based jobs—this includes template- and job-based which both support XML and CSV. PrintManager creates print jobs from the received data, directing the jobs to the appropriate printers. PrintManager supports the ZXP Series 3, ZXP Series 7, and ZXP Series 8 Card Printers.
PrintManager stores templates and images to be used for template-based printing. Templates are XML documents, and images are binary data which may be one of many formats including bitmap and jpeg. The variable data for a template-based print
job is packaged as a data document in XML or CSV le format. The ZMotif SDK is used to build print jobs from templates, image les, and data documents.
PrintManager can also receive ZMotif-based jobs directly. The ZMotif SDK can be used to build and send a print job to PrintManager.
ZMotif Job
XML Doc
Data Document
CSV Doc
Print Manager
PrintManager consists of three modules: Queue, Store, and Job. Queue Modules are virtual printers that receive data streams, parse the data, and send the data to the Store Module. The Store Module saves the data for future processing. The Job Module gets data via the Store Module, analyzes the data, creates print jobs, determines the appropriate printer, and tracks job status.
Queue Module
Queue Module
Queue Module
Store
Module
Job Module
PRINT MANAGER
2 PrintManager Programmer's Reference Manual P1057447-002
PrintManager Data
PrintManager Data consists of job-specic data received by PrintManager for
purposes of performing template- and job-based printing using the message interface
described in this manual. The job-specic data must be formatted as a document using the XML or CSV le formats. The data document is delivered to PrintManager
via TCP/IP from any host capable of streaming data documents via TCP/IP such as Linux, UNIX, and Microsoft Windows
The XML document shown below is an example of an XML-formatted data document used for a template-based print job.
<?xml version=’1.0’ encoding=’utf-16’?> <data template=’CuppaJoe’> <Name>Test Job</Name> </data>
The CSV document shown below is an example of a CSV-formatted data document used for a template-based print job.
template,Name CuppaJoe,Test Job
Introduction
PrintManager Data
P1057447-002 PrintManager Programmer's Reference Manual 3
Introduction
Print Job Processing
Print Job Processing
Print Job Processing refers to the tasks required to complete a print job. The tasks associated with the completion of a print job include receiving data documents when
template-based job messaging is in use, receiving job xml les when job-based
messaging is in use, and receiving ZMotif-based jobs when the ZMotif SDK is in use.
4 PrintManager Programmer's Reference Manual P1057447-002
Template-Based Printing
Template-Based Printing is a process that combines a template document and its required images (if appropriate) with a data document to create a ZMotif-based print job.
PrintManager uses the ZMotif SDK to build a print job from a template, its required image(s), and a data document.
Template documents specify the card layout by dening the required parameters.
These parameters include combinations of the following elements: font types, the number of sides to print (single or double), graphics, text, barcode, lines, rectangles, ellipses, and magnetic encoding (if supported). Some of these parameters become placeholders for data—the data document contains the data required by these placeholders.
Before a template and its required image(s) can be used by PrintManager to build a ZMotif-based print job, the template and image(s) must be stored where
PrintManager can locate them. The template interface specication includes
commands which enable templates and images to be programmatically stored by PrintManager.
Introduction
Template-Based Printing
ZMotif is a print job language that contains job characteristics and binary images. Software tools for Microsoft Windows developers that generate ZMotif are the ZXP Series printer drivers, and ZMotif Software Developer Kits (SDKs).
PRINT MANAGER
Stored Images
XML Doc
Data Document
CSV Doc
Data Binding
Stored Template
Create Print Job
P1057447-002 PrintManager Programmer's Reference Manual 5
Introduction
Sample Template
Sample Template
The following xml document is an example of a Template that would be stored in the PrintManager for use with data documents for print jobs.
<?xml version=”1.0” encoding=”utf-16”?> <template name=”text_job”> <fonts> <font id=”1” name=”arial” size=”12” bold=”yes” /> </fonts> <sides> <side name=”front”> <print_types> <print_type type=”color”> <graphic eld=” logo” type=”bmp” x=”100” y=”100” height=”150” width=”150” />
<text eld=”Firstname” font_id=”1” x=”100” y=”300” /> <text eld=”Lastname” font_id=”1” x=”100” y=”500” />
</print_type> </print_types> </side> </sides> </ template >
Sample Data Document
Data documents specify data to be bound with a template at job creation—they can be XML or CSV formatted documents.
The following XML document is an example of an xml-formatted data document used by the sample template on the previous page; its contents would be merged with the sample template’s contents to create a print job.
XML Data Document <data template=”text_job”> (template to be used with the data) <logo>zebra_logo</ logo > (data for print job) <Firstname>John</ Firstname > (data for print job) <Lastname>Doe</ Lastname > (data for print job) </data>
The following CSV document is an example of a CSV-formatted data document used by the sample template on the previous page; its contents would be merged with the sample template’s contents to create a print job.
CSV Data Document template,logo,Firstname,Lastname text_job,zebra_logo,John,Doe
CSV Data Docuement Items (not part of the CSV document) Template, placeholder in template
logo, placeholder in template Firstname, place holder in template Lastname placeholder in template text_job, template to be used with the data
zebra_logo, image le required by template
John, data for print job Doe, data for print job
6 PrintManager Programmer's Reference Manual P1057447-002
SDK-Based Printing
SDK-based printing is a process that makes use of Zebra’s ZMotif SDKs for building print jobs and sending them to PrintManager.
An application would use various methods in the SDK to build a print job. Once built, the job is then sent to PrintManager by making use of other methods available in the SDK. Unlike template-based printing, SDK-based printing delivers pre-built jobs to the PrintManager; therefore, it is not required to build the job. Instead, PrintManager simply forwards the job to an appropriate printer.
Introduction
SDK-Based Printing
P1057447-002 PrintManager Programmer's Reference Manual 7
8 PrintManager Programmer's Reference Manual P1057447-002
PrintManager Programming
Interface
Introduction
This chapter describes the methods for interfacing an application to PrintManager: template-based printing and SDK-based. The chapter focuses on ZXP Card Interface
which is the message-based specication for template-based jobs; it also provides
an introduction to the SKD-based approach.
2
Template-based printing makes use of template documents and data documents
to build print jobs. A template document describes a card’s layout by dening fonts,
sides, graphics, text, barcodes, QR codes, lines, rectangles, ellipses and magnetic
encoding. The template also species data and image binding. A data document denes the information unique to a card such as a customer’s name, an employee’s identication number, and date of expiration.
SDK-based printing makes use of the ZMotif Printer and Graphics SDKs to build print jobs. Using the SDK approach, each job is built through the use of methods provided by the SDK as if all aspects of the job were unique, even if common background images, titles, etc are part of each card produced.
P1057447-002 PrintManager Programmer's Reference Manual 9
PrintManager Programming Interface
Template Printing
Template Printing
The ZXP Card interface provides a standardized process for sending and receiving data to/from the PrintManager. Data documents can be comma-separated values (CSV), XML documents or binary data. Data is sent within an interface command payload; the payload can be: templates, images, job data, or functional commands. Responses will be XML formatted documents or binary data.
There are four ZXP Card interface commands supported by PrintManager: Store, Submit, Delete and Request. The Store command downloads templates and images on the PrintManager. The Delete command removes templates and images from the PrintManager. The Submit command sends data or functional commands to be
processed by the PrintManager. The request command is used to request specic
information from PrintManager including job status, list of available queues, and a
queue’s conguration.
10 PrintManager Programmer's Reference Manual P1057447-002
Loading...
+ 32 hidden pages