Printing Millennium Labels with Print Wizard Server Edition
Printing Millennium Labels with Print Wizard Server Edition
October 2005
Version 2.7 and 3.0 beta
1)Introduction
The Millennium library automation system, available from Innovative Interfaces, Inc. (III), can print spine labels or spine/pocket label pairs. However, this printing support is fairly basic. Print Wizard Server Edition (PWSE) is a product from Rasmussen Software, Inc. that can enhance and adapt the output from Millennium on its way to the printer.
While PWSE is a general purpose printing tool, there are a sufficient number of Millennium users who use (or are trying to use) PWSE that we have prepared this document to attempt to make implementation of PWSE easier for the Millennium user.
2)Concepts
Before we discuss the “how to”, we will explain some concepts that form the foundation of printing with Millennium and Print Wizard Server Edition.
a)Millennium’s client-server architecture
Millennium is intrinsically a client-server product. The server runs on a central computer, and maintains the database of information. The client, written in Java, runs on each user’s desktop, typically running in Windows. The client presents the user interface to the user, and communicates with the server as needed.
The server is also accessible using the “character-based” interface, meaning it accepts connection from a telnet or SSH client. Some administrative operations are possible only through the character-based interface.
b)The JetDirect protocol
There is a very popular and widespread family of network printer interfaces, both freestanding and built in to printers, called JetDirect (now owned by HP). These devices support a variety of printing protocols, one of which is referred to simply as “the JetDirect protocol”. This protocol is very simple, consisting of a very basic pipeline from a network socket to a printer interface. This protocol can be bidirectional, allowing reading status information from the printer, but as Millennium uses it, it is output only.
Print Wizard Server Edition is able to emulate this protocol. That is how PWSE receives data from Millennium. In some of the Print Wizard documentation, this is referred to as “listen mode”.
c)Data flow from Millennium to the printer
In order to get PWSE involved in the printing process, it must be inserted into the “printing pipeline” that flows from Millennium to the printer. It can be helpful to understand the options that Millennium has for printing. Some of these are “local”, meaning that the data is being sent from the Java client on the desktop to a printer that is “visible” from that Windows machine. Other options are server based; the data is sent directly from the server to a printer, over a network.
i)Graphics mode local printing
In this mode, the Java client sends the print job to a Windows-supported printer, using the Windows printer driver. This means the Java client can control the font, size, and spacing of all the text. It also means that, in keeping with the Windows printer model, all printing is page oriented – every print job uses a particular page size. For this mode to be effective an appropriate Windows printer driver must be used; do NOT use “Generic”.
ii)Text mode local printing
In this mode, the Java client sends a stream of characters directly to the Windows spooler, which then sends them to the printer. The Windows printer driver is not used, and it doesn’t matter what driver is specified. There does have to be a driver, however, as this is what Millennium uses to specify the destination of the print data; that is, what printer port it eventually goes out.
Because the driver is not used, this mode gives NO control of font, size, or spacing.
iii)System printers
Millennium can send print jobs out to system-connected printers, using the JetDirect protocol (Millennium does NOT support the LPR/LPD protocol). Printer destinations are specified by IP address and port (the default port is 9100).
(1)Print Wizard as a system printer
It is possible to configure a PC running PWSE as though it were a system printer. The PC involved must have a static IP address. PWSE runs on this PC in “listen mode”; that is, it emulates a JetDirect device. PWSE processes and modifies the print data and sends it on to whichever printer it is configured for.
Note that in this mode, Millennium thinks it is sending data directly to a printer.
iv)Workstation JetDirect
Millennium supports a printer connection known as “Workstation JetDirect” (WJD). In this mode, print jobs are sent out using the JetDirect protocol to the same IP address as the Millennium client is running on; that is, back to the PC. Note that this CAN be a dynamic IP address, but it can NOT be going through Network Address Translation (NAT), unless special steps are taken.
Because the print job goes back through the user’s PC, the print job is accessible and viewable to the user, and tends to print out close at hand.
(1)Print Wizard as a Workstation JetDirect printer
Millennium’s support for WJD is provided specifically for Print Wizard Server Edition. The typical installation of PWSE is running in WJD mode. PWSE runs on the user’s workstation, emulating a JetDirect device (in “listen mode”).
v)Localhost printing
There is another way to feed PWSE that avoids certain problems such as Network Address Translation, restrictive firewalls, etc. This method involves printing from the Millennium client, through PWSE running on the same PC. We refer to this as “localhost” printing. In a nutshell, the Millennium client is told to print to a printer driver on the PC, which is configured at the Windows level to send the data via TCP/IP to the “localhost” (the same machine), where PWSE gets it. PWSE then processes it and prints it out to a different printer driver.
For more information, see the document at
d)Printer definitions in Millennium
At the administrative level in Millennium (accessible through the character interface), each printer must be defined. Each printer definition has a name. Besides a name, a printer definition carries a few parameters describing the printer. Some key parameters are:
i)Diac Map
The term “diac” is short for “diacritics”. This setting references one of many available “diac map files” provided by III. It tells Millennium how to translate non-ASCII characters, including diacritics and international characters such as Chinese, Japanese, Korean, Russian, etc. In some cases these will include escape sequences that control certain types of printer. For use with PWSE, we recommend you select one of the available “UTF-8” entries (we don’t know how they differ).
ii)Type
The “type” of a printer really indicates how printer is attached, as explained in “Data flow” above.
iii)Device
This entry identifies the IP address and socket number of the network interface of the printer. The Workstation JetDirect “type” defaults here to “LOCAL” – leave it set that way (if you change it, you’ll have to get III tech support to change it back).
e)Printer access in Millennium
Once various printers are “defined” in Millennium (as above), a username (login) must be given permission to use them. Put another way, each Millennium login is given access to a list of defined printers.
f)Label data layout in Millennium
The content of the data to be printed on the labels is configured in Millennium, through the character interface. This consists of fields and layout information.
i)Fields
This concerns which fields of information, such as author, title, bib number, etc., are to be printed on the spine and optionally the pocket label.
ii)Layout
Layout concerns the physical dimensions of the label. Horizontal dimensions are in “columns”, which are usually assumed to be 1/10 inch each. Vertical dimensions are in “lines”, which are usually 1/6 inch each. There are measurements for the printable space, such as “Height of label, in lines”, and unprintable space, such as “Vertical space between labels on printout, in lines”.
(1)Millennium’s full-sheet support
Millennium has some support for printing full-sheet labels (more than one column of spine or spine/pocket labels). However, as of this writing, it supports only one layout. PWSE is not typically involved in this way.
(2)Millennium’s continuous-label support
More typically, Millennium will specify the layout of single-column labels (where a “column” is spine only or spine plus pocket). These labels are in a continuous feed stock, and are usually printed on a dot matrix printer such as an Okidata 320.
Print Wizard Server Edition is able to take as input this continuous-feed data, and convert it to full-sheet output. All the dimensions and control of this conversion are managed by PWSE; Millennium still thinks it is printing continuously. Note, however, that there are uses for PWSE even when you are still printing on continuous-feed stock.
The critical items that must be configured properly in Millennium in order for PWSE to work correctly are as follows:
(a)Vertical dimension
The important item here is the TOTAL number of lines issued per label, that is the sum of “Height of label, in lines” and “Vertical space between labels on printout, in lines”. This total will correspond to the “lines per label” discussed below.
(b)Horizontal dimension
Here again, the total is important. In this case, it’s the sum of “Width of spine, in columns”, “Width of label, in columns”, and “Width of gap, in columns”. This total is the width in characters of one “column” of labels (sorry about the dual use of “column”).
g)Character sets
Any time you want to print non-Roman characters, things get tricky. You have to ensure that all parties to the communication are speaking the same “language”; that is, using the same character set. Because of its universality, we recommend using UTF-8, which is a form of Unicode. As described above, you can configure Millennium’s printer definition for a particular “diac map”. Choose one of the “UTF-8” options.
For PWSE, you will use the “/u” command line parameter as explained below. This will tell PWSE that incoming data is in the UTF-8 character set. PWSE will then handle any special characters, diacritics, CJK, etc. automatically. This should work on any printer.
h)Command line parameters and Print Wizard
Command line parameters (CLPs) are a way to specify the operation of a program when it is started. Windows programs in general have moved away from this approach, at least on the surface, but it can be very useful. In the case of Print Wizard Server Edition (through version 2.7), almost all configuration of its operation is controlled through CLPs.
i)CLPs entered on manual program start
If you start a program by typing in its name, either in a command window (DOS prompt) or in Windows’ Start:Run item, you can include parameters after the name of the program. For instance, at a command window you might type in:
\printwiz27\printwiz /u /listen /debug /preview
ii)Setting CLPs in a desktop icon or start menu item
Behind the scenes, Windows still uses a textual method to start programs. If you right-click on a desktop icon or an item in the Start menu structure, select “Properties”, and go to the “Shortcut” tab, you will find an item called “Target”. This is the command that Windows executes if you activate the icon or menu item. You can edit this entry as necessary to make PWSE work the way you need it to.
The installer for PWSE creates several Start menu items. If you find the one named “Print Wizard – Listen Mode”, its Target should be something like
C:\printwiz27\printwiz.exe /l /vport=9100
You may want to adjust this item, or you may want to copy the Start menu item to your desktop to make a new shortcut that you can experiment with.
iii)Relevant CLPs for Print Wizard printing labels
All possible CLPs for Print Wizard are explained in the Print Wizard manual. They all start with “/” or “-“, but I’ll use the slash here. All are case INsensitive. One or more spaces separate parameters. Here are the parameters especially useful for label printing:
(1)/Listen or /Vport=nnn
Either of these makes PWSE run in “Listen mode”; that is, to emulate a JetDirect device. The parameter “/Listen” causes PWSE to listen on port 9100. To specify a different port, use “/vPort=nnn”, where “nnn” is the port number.
(2)/U
This tells PWSE that the character set of the incoming data is Unicode UTF-8, as explained above.
(3)/Preview
This tells PWSE to open a Print Preview window. This is critical to getting your layout right before actually printing anything. Also, it is the only way to reuse partial sheets of labels.
(4)/L
This turns on logging. PWSE will display some basic logging information each time it receives a print job. If nothing appears when you print something, it means the print job didn’t go through PWSE (it might have gone to the printer by some other route).
(5)/Debug
This causes PWSE to display MORE information (than the “/L” alone does) on each print job. It can be especially useful in determining how many lines and columns of data came from the server.
(6)/init=filename
This tells PWSE to use an “Init file”, as explained below.
i)Init files in Print Wizard
Besides CLPs (explained above), the other way you can alter PWSE’s behavior is with a “printer initialization file” or simply, an “init file”. An init file is a text file that can be edited in Notepad (or similar). Do not use Word or Wordpad, unless you explicitly save data as plain text.
Caution: when you save from Notepad, it may want to force a “.TXT” file extensions on you, even if you specify an extension. For instance, if you enter “mytest.init” as the file to save to, Notepad will actually create “mytest.init.txt”. Furthermore, if your Windows is set to “hide extensions of known file types”, this file will show as “mytest.init”, which can be VERY confusing. To avoid this behavior, put double-quotes around your filename in Notepad.
The content of an init file is usually Print Wizard Markup Language (PWML), which looks a lot like HTML. It specifies certain parameters by which a job should be printed, such as what the margins should be. PWSE internally inserts the init file onto the beginning of the print data coming from Millennium, and processes the combination as one stream of text.
Sample init files that correspond to commonly used Gaylord label stocks are provided in the Print Wizard installation, under the “Samples” subdirectory. These are a good way to get started. Find one, copy it to a new file name, and play with it.
PWML is a very powerful language. All its features are explained in the Print Wizard manual. Following are some key items for this application:
i)PAGESIZE tag
This tag tells PWSE some things about the overall layout of each page.
(1)x
This sets the horizontal dimension of the paper, usually “x=8.5in” (where “in” means “inches”).
(2)y
This sets the vertical dimension of the paper; such as “y=11in”. If you are printing to continuous-feed output, set this to the height of one label, as measured from top-of-label to top-of-label (pretend there is no gap between labels).
(3)linespacing
This sets the vertical increment from one line of type to the next. Standard spacing is 6 lines to the inch, so each increment is 1/6 inch, thus: “linespacing=.1667in”.
(4)length
This indicates how many lines should fit in one column. No units are given: “length=68”. If “length” is specified but “linespacing” is not, PWSE will calculate linespacing using length, topmargin, and bottommargin.
ii)FONT tag
This optional tag allows you to tell PWSE to use a different font or size. Note that size changes can affect layout. Note also that font changes affect the entire document. There is not a way to specify different fonts for different parts of a print job or different parts of a label.
(1)face
This specifies which named font PWSE will print with. The default is “Courier New”. You can choose a printer-resident font for speed, but this will generally give you less flexibility in sizing.
(2)size
This sets the height of the characters, usually in inches (“size=.1667in”) or points (“size=12pt”), where there are 72 point to the inch. If you set size it will reset linespacing (to the same value), unless you reset linespacing.
(3)pitch
This sets the width of characters, usually in inches (“pitch=0.1in”). If you are printing both spine and pocket labels, this will change the horizontal position of the pocket label data.
You can also set pitch to zero for variable-spaced fonts. However, if you are printing spine and pocket labels, this will mess up the horizontal placement of your pocket labels.
(4)linespacing
As above, this sets the vertical increment between lines. Set it if you want the linespacing to be different from the font size.
iii)B tag for bold
If you want bold text, include “<B>”.