Printing Millennium Labels with Print Wizard Service Edition
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 Service 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 PWSE that we have prepared this document to attempt to make implementation of PWSE easier for the Millennium user.
Before we discuss the “how to”, we will explain some concepts that form the foundation of printing with Millennium and Print Wizard Service Edition.
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.
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 Service 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”.
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.
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”.
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.
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).
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.
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.
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”).
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 on Setting up a localhost printer with Print Wizard.
- Graphics mode local printing
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:
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).
The “type” of a printer really indicates how printer is attached, as explained in “Data flow” above.
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).
- Diac Map
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.
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.
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.
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”.
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.
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”).
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.
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.
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
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.
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:
/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.
This tells PWSE that the character set of the incoming data is Unicode UTF-8, as explained above.
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.
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).
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.
This tells PWSE to use an “Init file”, as explained below.
- /Listen or /Vport=nnn
- CLPs entered on manual program start
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:
This tag tells PWSE some things about the overall layout of each page.
This sets the horizontal dimension of the paper, usually “x=8.5in” (where “in” means “inches”).
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).
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”.
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.
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.
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.
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.
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.
As above, this sets the vertical increment between lines. Set it if you want the linespacing to be different from the font size.
B tag for bold
If you want bold text, include “<B>”.
The BODY tag includes parameters that specify payout within the page. Dimensions are usually in inches.
Specifies the distance from the top edge of the paper to the top of the first line of text.
Specifies the distance from the top of the paper to the bottom of the last line of text or spacing.
Specifies the distance from the left edge of the paper to the left edge of the first column of text.
Specifies the distance from the left edge of the paper to the rightmost edge of printing or spacing.
Specifies the horizontal distance from one column of labels to the next column of labels, ignoring any gaps.
Optional, specifies the unprintable gap between the right edge of one label and the left edge of the next.
This indicates the end of initial tags and the beginning of data to be printed. It is usually the last line in the init file.
- PAGESIZE tag
Printer drivers in Windows
In order for PWSE to talk properly to a printer, and control it precisely, it must use a proper printer driver for that printer. Do not use “Generic”. If you experience problems with a printer’s behavior that you can’t otherwise explain, please check the manufacturer’s web site for a newer driver. Even if you just purchased a printer, do not assume that the latest printer driver is on the CD that came with the printer. Very often manufacturers discover and fix problems with new printers after the boxes have been sealed and shipped.
When PWSE runs in “Listen mode”, it must accept a connection that is inbound from the server. If there is any firewall software running on the PC (as there is on any new PC these days), and/or you have an external firewall in place, you will need to enable (“open”) the relevant port, which by default is port 9100. You may also need to put “printwiz.exe” on the approved program list for your software firewall.
Step by step into Print Wizard labels
With all that as background, the following are the steps to follow to make your labels print with PWSE.
Define a printer
In Millennium’s character-based administrative area, make sure a printer is defined that has a “type” of “Workstation JetDirect”. In fact, the printer definition may exist and it may also have a name of “Workstation JetDirect”. If no such definition exists, create one (or have this done by someone with appropriate permissions). Make sure the printer definition’s “diac map” is one of the “UTF-8” options (not critical if you’re doing only Roman characters).
Make the printer available
Make sure the printer name that is defined above is accessible to your particular login (username). This is an administrator function.
Grab a ruler
I know it sounds silly, but this all works only if you can take precise measurements of your label stock. Remember that horizontal measurements are often in tenths of an inch, and vertical measurements are often in 6ths.
Configure Millennium's label layout
As described above, make note of, and adjust if necessary, the “Label specifications” in Millennium. The total horizontal number of characters, divided by 10 (characters per inch), gives the column width in inches. This should not exceed the horizontal distance from the left edge of one label to the left edge of the next column of labels. The total vertical number of lines, divided by 6 (lines per inch), should not exceed the vertical distance from top of label to top of label. These are good rules to start with, but they can be adjusted later.
Log in to your Millennium client
For best results, after making changes above, log out (if necessary) and log in to Millennium Cataloging.
Select the printer
In your Millennium client, select as your “Label printer” the printer definition name described above.
Choose the Init file
Print Wizard includes many sample files for common Gaylord label stock, as “Gaylord-*.init”, in the “Samples” directory underneath the directory containing Print Wizard. Look at what’s available. Try to find the one that’s closest to your stock layout. Copy this file to one named “mytest.init”.
Set your Windows default printer
PWSE will, by default, print to the Windows default printer. Although it is possible to tell it to use a specific printer (by its Windows name), we’ll do that later if necessary. For now, go to the Windows printers area and make sure the printer you want to use is your default.
Configure a Print Wizard icon
Go to the Start button, “All programs”, “Print Wizard (whatever)”, and find the menu item “Print Wizard – Listen mode”. Right-click this item and choose “Send to:Desktop (create shortcut)”. This should leave you with a new shortcut on the desktop. Right-click this new shortcut, and click “Properties”. Find the “Target” item. Edit it to include all these parameters, after the actual filename:
/L /vport=9100 /debug /preview /u /init=mytest.init
This should all be one line. Then click "OK".
Start Print Wizard
Click or double-click this icon. Print Wizard may appear as a “DOS window” or as a graphical item, depending on version. It should be showing some initial information, including the command line by which it was invoked. Check it for accuracy.
Print a test label
Now print just ONE label from Millennium. While the Print Preview window is open, switch over to the main Print Wizard window showing the debug information. You should find a line that says “Data contains no pagefeeds; processed x lines”. Note what ‘x’ is. This should match your vertical total as described above. Likewise the line “Longest line is x columns” should match your horizontal total above. If either of these is not what is expected, then go back and make it right before proceeding.Now hit “Cancel” in Preview.
Print a test batch
In Millennium, generate and print a larger batch of labels, at least enough to stretch into the second column, and maybe further. The more the better, up to a whole page’s worth. The data should show up in your Print Preview. Don’t click “Print” yet.
Use Print Preview
First, if you are on a late version of PWSE, you can zoom the Preview window, to make it easier to see. Do so. Examine the data layout. If everything is perfect, skip ahead in these instructions. If there are problems, you can test making adjustments to your parameters (which came from your init file) in the Preview dialog. These adjustments will be temporary – they will be in effect only until you actually print the data. The goal is to let you experiment and determine what works. So first, see if you can get things to align correctly on the screen.
If things are in general alignment (they look like labels), but the data in the second column is a bit higher or lower than in the first column, try adjusting the bottom margin or the “Lines per inch”. If it looks like lines have wrapped, increase the “Characters per inch”. Adjust other characteristics as necessary.
When you have made the Preview look right, make a note of which parameters you have changed. Then hit “Print”, and check your actual printed output against your label stock.
Adjust the Init file
If you had to make adjustments in Print Preview in order for your alignment to be correct, you need to adjust the corresponding parameters in your init file. Do this by editing the file with Notepad. Save the file, and go back to “Print a test batch”. Repeat this process until you get your labels to print properly.
Adjust Print Wizard's startup
Once you have PWSE’s printing working correctly, you may want to remove some parameters (CLPs) from the icon’s Target. For instance, you may want to remove the “/Debug” parameter, and possibly the “/L” (for logging). You may also want to remove the “/Preview” parameter, if you do not need to preview what is going to print.To tell PWSE to print to a particular printer, you will need to get that printer’s exact name as defined by windows. Then add a parameter like this:
/p”windows printer name”
The quotes are necessary if there are spaces in the name.
Auto-start Print Wizard
For normal day-to-day operation, you will probably want Print Wizard to be up and running all the time. One way to do this is to drag or copy your icon into the “Startup” folder within your Start menu structure. Anything in the Startup folder is automatically started at Windows login. Note, though, that sometimes the sequencing of Startup items is tricky – if PWSE starts up before a clean network is running (and not blocked by a firewall), it could fail. If you have trouble with this, please contact us. Of course it’s always an option to start it manually by clicking on the desktop icon.
New in Version 3.0
As this is being written, version 3.0 of Print Wizard is in a beta test phase. If you are interested in participating in this beta process, please contact us. Following are some new features in 3.0 that apply here:
Graphical user interface
Where previously Printwiz.exe ran as a Windows “console” program (what looks like a DOS program), in 3.0 it has a graphical “skin” on it. In addition, a graphical front-end program, PWUI, provides various ways to configure and launch Print Wizard. However, PWUI is not essential to this set of instructions.
You can tell PWSE to install and launch a “Windows Service” program that does the “listening”, and then hands the print job off to the main Print Wizard program (printwiz.exe). The advantage of this approach is that the service can run when nobody is logged in to the Windows PC. This would be more appropriate if the PC were being used as an unattended printer server. Note that this would NOT be appropriate if you wanted to use the Print Preview feature.
Popup menu in Print Preview
In 3.0, when the Print Preview window is open, you can right-click in the area of the page image, and a popup menu will appear. This serves two purposes: it allows you to control “ink” markup, especially on a Tablet PC; and it allows you to specify a starting point for label printing – more on that below.
Previously, all font height descriptions referred to the nominal height of the letters. But a 12-point font, for instance, takes more than 12 points (1/6 inch) to print, because of descenders, diacritics, etc. This made it hard to force text to fit within a prescribed vertical space. Now you can specify the height of fonts by the height of the total cell they will occupy, using “Cellheight”. This is especially useful for label printing, as below.
Many of the descriptions above refer to making PWSE convert single-column data into multi-column label stock. In 3.0, we take this a step further. You can tell PWSE the vertical dimensions of your labels also, and it then deals with them as individual labels and not just columns. This is controlled by additional parameters in your init file; these parameters are also accessible in Print Preview. Parameter changes are:
The Rowoffset parameter (in the BODY tag) specifies the vertical dimension from the top of one label to the top of the next label. Rowoffset and Columnoffset must both be set to make PWSE work in “label mode”.
This optional entry indicates the vertical space that should not be used between the bottom of one label and the top of the next.
In label mode, the Length parameter can now indicate the number of lines per label, instead of per page.
If you want to print labels in order by row, you can now include “Labelorder=row”.
Reuse of partial sheets
Finally, it is possible to tell PWSE to start printing at a certain label, so you can reuse partial label sheets. In the Preview window, just right-click in the correct place, and in the popup context menu select “Start printing here”. There is not an init file entry for this item, because it would change every time.
Sample Init files
Version 2.7 compatible
Following is a sample init file for Gaylord 9001 labels. This is compatible with version 2.7 and later of PWSE:
<!-- Change as needed -->
<PAGESIZE X=8.5in Y=11in linespacing=12pt orientation=portrait > <BODY topmargin=.5in leftmargin=.35in rightmargin=8.15in bottommargin=10.5in columnoffset=4.1in columngutter=.4in ><LEGACY>
For row-oriented label format
Following is a sample init file for printing Gaylord LSL01 labels in row order. Note that some elements in this file require PWSE version 3.
<!-- ROW_ORIENTED Sample PWML print initialization file--><LEGACY>
<!-- For Gaylord LSL01 -->
<!-- Change as needed -->
<PAGESIZE X=8.5in Y=11in linespacing=12pt bin=7 orientation=portrait length=9 > <font face="Courier New" cellheight=12pt> <BODY topmargin=.25in leftmargin=.25in rightmargin=8.25in bottommargin=10.75in columnoffset=1in ROWoffset=1.5in labelorder=row >
If you have any questions on the above information, feel free to call or email us at email@example.com