Skip to main content

Print Wizard Technical Notes

Capsule Description

Print Wizard is a body of software from Rasmussen Software, Inc., that processes and prints text. It exists in several forms, in several products. It runs on a Windows PC, but in many cases prints files that originate on Unix/Linux systems.

Print Wizard takes plain text print files and prints them intelligently, automatically fitting them to the page. It prints existing print files/jobs but with modifications, including adding form overlays. It can also take text files that contain markup tags similar to HTML, process that input, and create the printout as directed.

Print Wizard can accept files that contain international characters as Unicode data (in UTF-8 form), and print them correctly. It can automatically select fonts that contain the needed characters.

In addition to printing its output, Print Wizard can output to fax, with no user intervention. And it can create PDF files, optionally viewing and/or emailing them.

The Need

  • Legacy reports, designed for particular printers, won’t print correctly on other printers.
  • PCL print jobs have to be printed on non-PCL printers.
  • Print jobs must be distributed over networks, even around the world, even with dynamic IP assignment.
  • End users may need to customize output formats.
  • Web browsers do not do a good job of printing, especially wide reports.
  • Users may need to superimpose form images.
  • Developers using some programming languages may need to create fancier printout than those languages provide, with font changes, line drawing, pictures, etc.
  • Most printers can't handle Chinese, Arabic, Cyrillic, etc.
  • Print files may use backspaces for underlining or bolding, tabs, and other conventions.
  • Any of this output may need to be faxed or emailed, automatically.
  • Users may need to generate, view, and email PDF files.
  • Print jobs must be faxed automatically, with attachments.

The Solution

Print Wizard exists as a) Print Wizard embedded included with our AnzioWin terminal emulation, a Windows-based telnet (terminal emulation) program; b) a freestanding Windows program; c) a Windows DLL; and d) an ActiveX object. Additionally, the freestanding Print Wizard package comes as two separate licenses, Print Wizard Personal Edition and Print Wizard Service Edition.

The Print Wizard Personal Edition will print any local file to printer, fax, email, PDF, TIF, or out to a local file. This includes the Print Wizard DLL.

The Print Wizard Service Edition contains all the features of the Personal Edition plus support for Windows and local services that can despool from local or shared network directories, as well as support for "listening" on a network port or receiving print jobs over the LPR/LPD protocol common on all Windows and UNIX/Linux server platforms.

In every case, Print Wizard receives as input a text file containing data to be printed, and writes out to the Windows printer driver (or in some cases directly to the spooler or the port), or to a fax driver, or to a PDF file. The text file can be in the Windows character set, in the DOS character set, or in Unicode UTF-8. Print Wizard always tries to render the data in a logical manner, without user intervention.

When Print Wizard receives print jobs containing either PostScript or embedded escape codes, it passes them on transparently to the Windows spooler. However, if escape codes constitute PCL5, Print Wizard can translate that PCL5 and render it on any output device (including PDF and fax).

When Print Wizard receives print jobs with plain text (possibly including tabs, backspaces, and formfeeds), it analyzes the print job, determines the number of rows and columns in the job, and scales the printing separately in the horizontal and vertical dimensions in order to automatically fit the job to the page. Special logic handles very short pages on continuous feed printers, making the page only as long as is needed. Optionally, Print Wizard can automatically print wide format jobs in landscape orientation.

Print Wizard defaults to using the Courier New font. It can be configured to use any other font, including printer-resident fonts for speed. While printing, Print Wizard checks to make sure every character exists in the font being used. If not, Print Wizard will search the installed fonts on the PC for any that contain the necessary coverage. Thus you can switch from English to Chinese, for instance, automatically. Print Wizard also has special logic to handle combining diacritics.

If the print job contains HTML or PWML (Print Wizard Markup Language), Print Wizard will parse those tags and print accordingly. Not all of HTML is covered; however, additional tags not found in HTML provide added features, such as paper control, barcodes, and forms overlays.

Output of Print Wizard can go to any printer that has a Windows printer driver. Or, it can be sent to a fax package on Windows. Special provisions allow the output to be faxed to a specified phone number, using WinFax Pro, the Windows MAPI interface, or the built-in fax support in recent versions of Windows. And if the Print Wizard can create PDF files and optionally view and/or email them, using its own built-in PDF generator.

All control of Print Wizard can be accomplished using ASCII characters (plus return, linefeed, formfeed, etc.), so print output can be generated in virtually any programming or scripting language.

Operation

Because Print Wizard exists in several forms, there are several ways to operate it:

Passthrough print in AnzioWin

Any character-based application on the host that has passthrough print support can print through AnzioWin’s Print Wizard module. Host routines that perform passthrough print are available from Rasmussen Software.

Backchannel printing in AnzioWin

When AnzioWin is connected using SSH, a separate print channel can be opened for printing. This print data is encrypted during transmission.

Command-line driven

With a Windows command string, tell Print Wizard to run and print a certain file from the local disk, networked disk, FTP server, or web server.

Despooler mode

Run Print Wizard so it watches a particular directory for files to appear, then prints and deletes each file. The directory can be on any file system visible to Windows, including via Samba or similar.

Listen (JetDirect) mode

Print Wizard emulates an HP JetDirect device, capturing and printing whatever comes in on a specified IP port (e.g., 9100). Various host-side utilities can send this data out.

Follow-me printing

The provided “netprint” utility on the host can send print data in JetDirect protocol to the same IP address as a telnet or SSH session is coming from. So printout goes to the same PC the user is logged in from.

LPD

Print Wizard Service Edition includes PWLPD, an LPD server. Configure the host to have a “remote” printer installed at a particular IP address, and the host will send print jobs to PWLPD at that location.

Windows Services

Despooler mode, Listen mode, and LPD can all be run as Windows Services, so they can to run when no one is logged in to the PC.

DLL

The PrintWiz.DLL module can be called from a variety of languages, with as few as 3 calls.

Registered print handler

Print Wizard can configure Windows to invoke Print Wizard when you need to print files with certain file extensions.

Drag-and-drop

Drop a file on the Print Wizard program to print the file.

Smart Print

Print Wizard can send .DOC files through Word to a printer, for instance.

Secure printing

Print Wizard can fetch a file from an https server, using encryption. Passthrough print and backchannel print can also be encrypted.

OCX (ActiveX)

Web Print Object (WēPO) is an ActiveX object that can be installed on a PC and invoked by a web page. This allows accurate printing to be “pushed” from a web server.

Altering Existing Reports

Most means of invoking Print Wizard allow the user to specify a print initialization file. This is a simple text file that is prepended to the main print job. Typically, it contains markup codes to configure the printing, specifying such things as font, character size, paper size, margins, orientation, and form overlay.

General Features

Following are some features and capabilities of Print Wizard. The methods for initiating these features will vary depending on how you are running Print Wizard.

Printer independence Render consistent output on any Windows-supported printer, even Windows-only printers
Paper control Control input bin, paper size, orientation, margins, duplex, gutters, copies
Bin cycling Input bin, paper size, etc. can be varied or cycled within a print job
Auto orientation Wide reports can be switched automatically to landscape
Auto-fit Automatically fit plaintext reports to the page, possibly with auto-rotation to landscape for wide reports
Character set support ISO, OEM, or Unicode UTF-8
Auto font support Automatically find and use appropriate fonts for non-Latin characters
Linage guessing Files without formfeeds are paginated using pattern analysis
Label printing Single-column output, such as labels, can be converted to multi-column output. Labels can be printed in row order or column order. Partial label sheets can be reused.
Mini-pages For short print files on continuous feed printers, create an appropriate page length; used for receipts, one-up labels, etc.
PCL5 translation Files in PCL5/PJL/HPGL can be translated and output on any printer or other output
PCL5 printer control Store and use PCL overlays in a PCL5 printer
Tabbed file handling Tab-separated values files can be aligned automatically
Backspace handling Backspace-bolding and backspace-underlining are recognized and converted
Full-page printing Bitmap and meta files are printed at full-page size
Form overlays Use a BMP, GIF, JPG, WMF, EMF, SPL, or PCL file as a form, combined with a print file
Overlay cycling Different overlays can be used on different pages.
Fax support Output to fax, with specified target phone number, using WinFax Pro, Windows MAPI, or fax support built in to Windows 2000 and later. Specify cover sheet and attachments.
Print preview Preview a print job. Adjust job parameters before printing.
Annotating print preview On TabletPC (and some Windows XP systems), draw on the Preview window, or sign a form. Annotations are printed on first page of printout.
Scanner support Scanner input can be used as form overlay or other image
Barcode printing Generated internally; no fonts needed
PDF generation Built-in PDF generator allows all these features to be rendered to PDF.
EMF generation

Print jobs can be rendered to EMFs (meta files).

Sub-jobs

One input job can contain many sub-jobs, each specifying a print job, a fax, a PDF generation, etc.

Regular expressions

Incoming lines can be filtered with regular expression search and replace

PWML Features

Print Wizard Markup Language (PWML) is derived from HTML. Some features of HTML, such as tables and freeform text, are not supported. In other areas, PWML extends HTML. The following is a list of supported features:

Paper size

Letter, legal, etc.
X by Y, in inches, cm., etc.

Orientation

Portrait, landscape, auto

Paper bin

Upper, lower, tractor, etc.

Media

What kind of paper is to be used.

Page margins

Top, left, bottom, right
Gutter Provides binding space
Copies How many copies should be printed?
Length Assumed lines per page (if no formfeeds)
Linage guessing occurs if not specified.

Linespacing

Vertical increment between lines.

Duplex

Long edge, short edge
Left, top

Bitmap overlay

On any printer
Stretched to full page
BMP, GIF, JPG

PCL5 overlay

On PCL5 printers, using printer's macro capability
On any printer, PDF, or fax using PCL translation
Can be multi-page

Metafile overlay

EMF, WMF, SPL

PWML overlay

PWML describes pages to be used as overlays.

Multi-column

Convert single-column print data into multi-column format

Labels (multi-column, multi-row)

Convert continuous label format to multi-column, full-sheet format.

Font

Face="name"
Face="name1, name2, …, auto" for auto font selection

Font size

In inches, cm, points, etc.

Font pitch (horizontal)

In inches, cm, points, etc.

Text sizes (HTML style)

SMALL, BIG, H1, etc.
Sizes 1 through 7

Text rotation

Any angle

Text effects

Bold, italic, underline

Text positioning

Subscript, superscript

Text color

Black, white, red, etc.
By hex RGB value
Grayxx

Background color

As in text color

Tabbed alignment

Create columnar reports with variable-pitch fonts

Paragraph, division alignment

Left, right, centered, filled

Text placement

Text can be placed precisely, anywhere on the page.

Horizontal lines and rectangles

Size (height)
Width
Color
Outline
Precise placement, or inline

Line

Horizontal, vertical, diagonal
Width, color

Image types

BMP, JPG/JPEG, GIF, WMF, EMF

Image source

Local disk
Network disk
FTP, HTTP, or HTTPS server

Image size

In inches, cm., etc.

Image placement

Aligned with text, or in precise location relative to the edge of the paper

Image alignment

Top, middle, bottom

Image space

Horizontal space around image
In inches, cm., etc.

Barcode styles

UPCA, UPCE, EAN13, EAN8, 2OF5, CODABAR, CODE11, CODE39, CODE93, CODE128 (a, b, c), PostNet, MaxiCode, PDF417

Barcode options

Bearer bars, tall guard bars, caption, guard characters, add check character, bar widths

Barcode size

In inches, cm., etc.

Barcode rotation

0, 90, 180, 270

Barcode caption

Face (font), size

Character entities

By name
By decimal value
By hex value

Platform Support

Print Wizard is a 32-bit Windows program. It runs on Windows 95, 98, ME, NT4, 2000, XP, through Windows 10 (32-bit or 64 bit).

Host-end modules are available for most Unix/Linux platforms.

Licensing

Print Wizard Personal Edition
Includes the user interface, the Print Wizard executable, and the DLL. It is licensed on per-PC bases, with each license supporting up to 3 printers. It can not be run on servers supporting Terminal Server or Citrix clients.

Print Wizard Service Edition
Contains all the features of Personal Edition, and adds the PWLPD program, despool support, and JetDirect emulation ("listen mode"). It is licensed per server.

AnzioWin
The Windows-based terminal program, contains Print Wizard Embedded for use in passthrough print.

Web Print Object (ActiveX module)
Also called WēPO, for web-based printing, is licensed per server.

How Print Wizard Works

Print Wizard is a print processing engine that runs on Windows (XP and later). It takes as input streams of plain text, and outputs to any printer (or fax driver) that Windows supports. This print engine has been implemented as a program, (PRINTWIZ.EXE), as a callable module (PWDLL.DLL), as a series of print server services, and as an integral part of AnzioWin, a telnet (terminal emulation) program also from Rasmussen Software.

There are several components that make up Print Wizard:

PWUI

The user interface for Print Wizard allows you to setup the various defaults and adjust printing options. This includes setting the default faxing and email methods, setting up print profiles (descrptions on how a print job should print), selecting overlays and initialization files, and configuring and turning on and off Print Wizard services. Through this you can also setup and watch the various log files that can be created.

Print Wizard engine

This does all the real work, processing print jobs according to the source and target for that job.

PwLPD, PwListen, PwFtpDespool, PWDespool

These programs represent the four stand-alone services within the Print Wizard Server Edition, allowing print jobs to be received from remote sources.

PwServices

This program watches for remote print jobs as a Windows Service.

PwDLL.dll

Most all of the Print Wizard print functions can be called from a DLL (Dynamic Linked Library) through your own application, allowing for a much more tightly integrated print utility.

The diagram below shows some of these relationships and how they fit together.

PW Tech Note1

Print Wizard can process text that comes to it in a variety of ways:

  • From a host system, via passthrough print
  • From a PC disk file
  • Generated by various programming languages in Windows
  • Fetched from an FTP or web server
  • Despooled from a PC directory
  • From Windows Explorer, as the designated print agent for a particular file type
  • From a host system, via the LPD/LPR protocol
  • From a host system, using the "net direct" protocol

Print Wizard can take as input:

  • Plain text files
  • Text files with formfeeds, tabs, backspace-bolding, and backspace-underlining
  • Text files with embedded control sequences
  • PostScript files
  • Text files with markup tags

Print Wizard can output:

  • Plain text reports that always fit the page
  • With specified orientation, paper size, bin, and duplex
  • Bolding, italics, and underlining
  • Font changes
  • Multilingual characters (Unicode), including the Euro
  • Rectangles, gray bars, and color bars
  • Color text, including white-on-black for security
  • Bitmaps (inline or precisely placed)
  • Bitmap form overlays
  • PCL form overlays (on suitable printers)
  • Barcode
  • With precise placement of print elements
  • Multi-column labels
  • One-at-a-time labels on continuous forms
  • Variable-length output, such as with receipt printers

Print Wizard solves a wide variety of printing problems:

  • Data processing reports that won't print right on a laser printer
  • Line wrap and page break problems
  • Multilingual printing requirements
  • The Euro
  • Driving fancier printout from legacy programming environments
  • Printing from scripting languages
  • Printing from DOS programs in a Windows environment
  • Printing to "Windows only" printers from legacy environments
  • Programmatic faxing
  • Printing "print-to-file" files from PC disk
  • Printing to serial, parallel, and network-connected printers
  • Printing HTML pages that browsers don't print well

Print Wizard is designed to work with any printer that Windows supports. However, its input is completely device independent. With Print Wizard you can program your print output without locking in to a particular type of printer.

Where most Windows programs let you interactively design and print your output, Print Wizard lets you program your output.

Print Wizard's Text Processing

Print Wizard takes as its input a "text stream". This may be a file, or it may be a arriving via some sort of streaming protocol. However, its operation is basically the same.

Print Wizard's logic is designed to handle three general classes of input:

  • Raw Text - text with embedded control sequences, or PostScript data.
  • Plain Text - text with linefeeds (LF), and optionally carriage returns (CRs), tabs and formfeeds (FFs).
  • Marked-up Text - text with Print Wizard's Markup Language (PWML), which is based on HTML, or HTML itself.

Print Wizard will first determine what class of input it has. If it is raw text, it will be sent to the printer at a very low level, bypassing the Windows printer driver. For plain text, Print Wizard will analyze the report to determine the number of characters per line and, if formfeeds are present, the number of lines per page. Based on this information, and the printable size of the page, it will set the font size, spacing, and margins, in each direction, and then print out the report using the Windows printer interface. In some cases, it will decide what length the page needs to be, and will create a custom page length.

If Print Wizard detects its markup language, it will proceed as with plain text, but the various markup tags can control virtually all aspects of its behavior. The markup language can also direct Print Wizard to print certain other non-text items, including barcodes, bitmaps, and rectangles.

The following sections describe these features in detail.

Print Level Switching

Print Wizard starts off by assuming that it will print at a high level; that is, it will use the Windows printer interface to draw characters (and other things) on each page. This high-level print is Windows' preferred (and assumed) way of printing, and provides access to the Windows spooler function, as well as support for printers connected via serial, parallel, network, and other means.

This approach is a problem if the data stream contains escape sequences, such as the one that puts an HP LaserJet printer into compressed mode. If printed at high level, these escape sequences would be "drawn" on the page, and they would not be obeyed; that is, they would not affect the printer's printing. So print jobs of this type must be printed at "spooler" level.

Likewise, if the print job contains PostScript code, printing it at high level would result in a listing of the PostScript instructions, instead of the intended printout. Print Wizard detects PostScript jobs by seeing if they start with "%!". These print jobs must also be output at spooler level.

In spooler level, Print Wizard writes directly to Windows' spooler, bypassing the printer driver. The printer can still be connected via parallel, serial, network, JetDirect, etc.

(Earlier versions of Print Wizard used "raw" level; this has been superceded by the spooler level).

The remaining sections describing Print Wizard's text handling do not apply to spooler mode.

Basic Text Handling

This section assumes that Print Wizard is writing text at a high level. A font has been chosen by some means, and character size, spacing, and margins in each direction have been determined (more on that later). What follows is a description of Print Wizard's basic text handling.

Print Wizard assumes line-oriented text, with a linefeed (hex 0A) and optionally a carriage return (hex 0D) at the end of each line. It does not currently have the capability of doing freeform, centered, justified, or filled text. Each line of input is assumed to be intended as one line of output. If lines are too long to fit within the margins, the line will be broken at the character (not the word); no characters are ever lost.

If a tab (hex 09) is encountered, Print Wizard assumes that tab stops are every 8 columns, and will advance to the next tab stop.

If a backspace (hex 08) is found, Print Wizard checks to determine whether it is being used to cause over striking of the same character (backspace bolding) or underlining. It will convert these cases to actual bolding and underlining, respectively. For other cases of backspacing, Print Wizard will overprint the characters as indicated.

When a formfeed (hex 0C) is found, or when no more lines will fit on the page, Print Wizard will advance to the next page.

Print Wizard will also attempt to avoid printing blank pages at the beginning of the print job.

Auto-fit Logic

Print Wizard attempts to determine the best way to fit the text to the page. It does this by analyzing the first several hundred lines of data. In a plain text print job, this begins at the beginning of the file. In a marked-up print job, it begins when a <pre>, <listing>, <xmp>, <legacy>, or <plaintext> tag is found.

Print Wizard makes its decisions based on convention and readability. For instance, it is conventional to have 10 character per inch horizontal spacing, and it is conventional to have 66 lines per page. But it would not be readable to have more than 20 characters per inch.

Print Wizard analyzes lines to determine the maximum number of character per line. It then checks to see the page size selected, or more precisely, the printable area. Based on these factors, it determines character width, pitch, and left and right margins.

It also checks to see whether the data is paginated; that is, if it contains formfeeds. If so, it determines maximum lines per page. If not, it checks whether 66 lines per page is reasonable; failing that, it checks whether 6 lines per inch is reasonable. With a lines-per-page measure determined, it calculates character height, line spacing, and top and bottom margin.

Any of these calculated values can be overridden with markup tags.

Mini-page Logic

Print Wizard has an additional feature that makes it easy to print a small number of lines, such as might occur when printing one label at a time.

If a) the selected paper feed is "tractor", and b) you haven't specified orientation, paper size, etc., and c) the number of lines in the print job would constitute less than 80% of a page, if printed at 6 lines per inch, then Print Wizard will automatically adjust the page size to exactly fit the text, at 6 lines per inch.

So suppose Print Wizard gets a print job containing exactly 12 lines, and it is configured to use a tractor-feed printer with letter-size paper. After applying the tests above, it configures the print job for a custom paper length of 2 inches, then prints the 12 lines. This can be repeated indefinitely, and each print job will use 2 inches of paper. Thus, if continuous-feed label stock is used, with 2-inch vertical spacing, printing will be correct and no labels will be wasted.

Print Wizard's Markup Language

Print Wizard's markup language (PWML) is based on HTML. This has several advantages. It is known by many programmers and web designers. It is based entirely on printable ASCII characters. It can be created with any programming language. And it adapts easily to dealing with text-only data.

But HTML is lacking in two key areas: precision and pagination. It does not allow precise placement of print elements. And it is designed primarily for the screen, not the printer; it has no concept of a page break. (Some of these issues are being addressed, with CSS for instance). So Print Wizard's markup language extends HTML in these and some other areas.

Conversely, Print Wizard is targeted at printing "line printer" type legacy printouts. Thus it does not (yet) handle text justification or word wrapping. However, it can print some kinds of HTML documents, such as those that use <listing> or <pre> tags. In this document, we will use "PWML" and "HTML" as virtually synonymous.

Print Wizard allows you to move incrementally into the markup language. Suppose you have a print file that contains 132 columns of data. If you feed this to Print Wizard when it is set to portrait orientation, Print Wizard will compress the font horizontally in order to fit 132 columns onto the page. But now suppose you require that report to print out in landscape orientation. You can simply add to the beginning of the file:

<HTML><pagesize orientation="landscape"><BODY><PLAINTEXT>

and you will accomplish your objective. Similarly, you could specify other "job-level" parameters such as paper size, bin selection, font, line spacing, and lines per page. You could even specify a form overlay (or watermark). But the original text would not need to be changed at all.

In fact, you can place these initial sequences in a separate file, and instruct Print Wizard to prepend (insert at the beginning) that file.

At the next level, to use bolding, italics, or underlines, you could insert simple tags like "<B>" to start bolding and "</B>" to end bolding, in the body of your report. You could also indicate special characters, such as "&euro;" for the Euro character. You would need to change the <PLAINTEXT> above to <PRE>, so that tags would be recognized.

But in <PRE> mode, your existing data might contain things that looked like tags ("<") or like character entities ("&"), so you'd have to change "<" to "&lt;" and change "&" to "&amp;". To avoid that need, there is <LEGACY> mode. In <LEGACY> mode, tags (starting with "<") and character entities (starting with "&") must be preceded by a "trigger" control character, which is normally control-Z; otherwise, they are not recognized, but are printed as plain text.

Finally, you could advance to including bitmaps, barcodes, rectangles, etc.

A later section explains the details of Print Wizard's markup language.

Using the Print Wizard Engine

You can call the Print Wizard engine directly by passing command line parameters to Print Wizard. This allows you to script the way in whcih Print Wizard will print a specific job either from a script, batch file or through your own application, or just from a command prompt in Windows.

Below is a partial list and examples of some switches that may be used on the command line. Refer to the Print Wizard documentation for more information on available switches. Print Wizard is started with a command in the form:

Printwiz [parameters] [filespec]

The [parameters] are optional, and are case insensitive. The [filespec] is also optional. Don't enter the "[" and "]". Possible parameters are:

  • /s means do printer setup first. This allows you to select which printer to use, and also choose printer-setup items such as paper size.
  • /l[logfile] indicates logging. If no logfile is specified, logging will be to the screen.
  • /p"printer string" sets which printer, by its Windows name, such as
  • /p"HP LaserJet III"
  • /f[filename] means print to file (or device). If a filename is not given, you will be prompted for it.
  • /bh means duplex with horizontal binding (requires duplex printer).
  • /bv means duplex with vertical binding (requires duplex printer).
  • /I means file is in ISO character set (otherwise assume PC set).
  • /w means wait for despooling.
  • /d means delete (combine with /w for wait-then-delete).
  • /k means keepalive (see below).
  • /cnnn sets baud rate to ''nnn'' if printing "raw" to a serial printer.
  • /vLEVEL=xxx forces print level to "xxx", which can be "HIGH" or "LOW" or "RAW" or "SPOOLER".
  • /vTAGS=OFF turns off tag processing, in order to print HTML or PWML source.
  • /vDEBUG turns on debugging mode.
  • /vDOCNAME=name will use "name" as the document's name, which can be seen and tracked in the Windows spooler.
  • /vPORT=num causes Print Wizard to "listen" on port "num" for a "net direct" connection.
  • /vINIT=filename tells Print Wizard to insert the text in file "filename" at the front of each print job.
  • /vFORMAT=IBMFBA tells Print Wizard the input file is in IBMFBA format.
  • /r means to rename the file (to a unique name) while it is being printed.

The filespec can be

  • a single file,
  • a dash ("-"), which means to use standard input (stdin)
  • a wildcard,
  • a URL.

A filespec is NOT used if /vPORT is used.

Examples are provided below.

Print a file on the default printer:

printwiz myreport.txt

To print a group of files on a specified printer:

printwiz /p"My Deskjet" \temp\*.txt

Printers are identified by name. The name given must match what is shown in the Printers control panel. However wildcards can also be used for the pritner in which case, the first matching printer would be used:

printwiz /p"HP PSC*" \temp\testfile.*

To print a file from an FTP server:

printwiz ftp://somehost.com/pub/myfile.txt

(In this case, Print Wizard will do an anonymous connection to FTP to retrieve the file)

Using the Print Wizard DLL

The Print Wizard DLL can be called from within your application to print files from the same sources and in much the same way as mentioned above. In addition you can feed the DLL with direct print data containing various attributes defined in PWML (the mark-up language for Print Wizard).

Check out our various examples and documentation on our web site and in the manual for more information.

Print Wizard Services

Print Wizard Server Edition comes with several utilities for watching for remote print jobs. A print service can run as either a Windows Service or as a Print Wizard Service.

A print service through Windows Services

A print service from Print Wizard Server Edition can run as a standard Windows Service. This means that the print job can be received even if there is no one logged into Windows, allowing for an "always on" situation for receiving print jobs remotely.

A print service through Print Wizard Services

A print service from Print Wizard Server Edition can run as a stand-alone application (a normal Windows application) or from the Windows Startup folder. This allows a print job to be received ONLY when someone is logged into Windows and thus obeying the logged-in user's security settings and permissions.

Print jobs can come to the PC running Print Wizard Server Edition through a stand-alone service we call a Print Wizard Service. These include the following methods for receiving a job:

Despool - Print Wizard Server Edition can watch single or multiple directories or shared network drives for any file or a wildcard pattern of files and then "despool" those files when received, pushing them through Print Wizard.

Listen - Print Wizard Server Edition can listen on a specific network port for incoming print jobs and pass them through our Print Wizard engine to process. This is isimilar to the protocol used by Hewlett-Packard network printers and JetDirect© devices. This can also be set up as a "localhost" printer in this manner, making Print Wizard into a local print driver.

LPD - Using the LPR/LPD protocol available to all Windows and UNIX/Linux systems, Print Wizard Server Edition can receive print jobs and process them as a print server application.

FTP Despool - Utilizing the FTP protocol, Print Wizard Server Edition can watch a remote directory on a timer, for dropped files that need to be printed locally. In this manner the FTP Despool can work over standard firewalls to print files locally from a remote location.

Default print processor

You can tell Windows that you want to use Print Wizard to print files of certain extensions (such as ".TXT", ".PWL", etc.). Then, in Windows explorer, you can point to one of these files, right-click, and choose "print". This allows oyu to set up a default print type using the Print Wizard engine for any file extension you want.

Check out the manual for additional information on how to do this.

Using Initialization Files

Regardless of how Print Wizard is invoked, it is possible to specify a print initialization file, with the "/vINIT=filename" parameter. The file identified by filename should be a plain text file, created with an editor such as NOTEPAD or EDIT. Whatever is in the initialization file will be inserted onto the beginning of the data file. The initialization file can contain a) escape sequences, or b) PWML initialization tags. If the file contains escape sequences, that will force Print Wizard to switch to spooler mode, so that the initialization file and then the data file will be sent at a very low level to the printer, bypassing the Windows printer driver. The escape code sequences must be appropriate for the kind of printer involved. This is a less-common use of printer initialization files.

More often, the file will contain PWML tags. These can initialize the Print Wizard process, establishing job-level parameters such as paper selection, orientation, font, overlay, etc. The initialization file will generally leave the print process in a mode such as PLAINTEXT or LEGACY.

Print Wizard's Markup Language

As stated earlier, Print Wizard's markup language (PWML) is based on HTML. A book about HTML may be useful to those unfamiliar with this coding concept. This document assumes some basic familiarity with HTML.

Because of Print Wizard’s focus on legacy data, it is not yet fully compatible with generic HTML. Many capabilities of HTML have not yet been implemented, including freeform text, tables, and frames.

Recognizing a Marked-up Document

Print Wizard detects marked-up data as a file starting with any of (case insensitive):

<!DOCTYPE

<HTML

<PWML

Tag Basics

Print Wizard's tag structure, like HTML, consists of tags between less-than and greater-than, such as:

<PRE>

If you are in LEGACY mode (after a <LEGACY> tag), the less-than must be preceded with a "trigger" character, normally control-Z.

Most tags have additional parameters, such as:

<FONT face="Courier New">

If the parameter value contains embedded spaces, the parameter must be in quotes as shown. If there are NO embedded spaces, the quotes are optional.

The parameter value for some parameters must be numeric, implying there is a need for units of measure. These are described later.

Some tags have a corresponding ending tag, such as "<B>" to start bolding, and "</B>" to end.

Tags are case insensitive, and can be continued from one line to another.

The Bare Minimum

Print Wizard will not actually start printing anything until it gets into the plain text part of the file. That is, it must encounter a <PRE>, <XMP>, <PLAINTEXT>, <LEGACY>, or <LISTING> tag. Since any of these should be inside the <BODY> section, a minimal set of tags (that does not alter Print Wizard's default behavior) is:

<HTML><BODY><PLAINTEXT>

The differences between the five tags above involve a) what kind of tags are allowed after each, b) assumed width, c) whether ampersand character entities (explained below) are allowed, and d) whether a trigger character is needed.

After the PLAINTEXT tag, no other tag or character entity processing or is done.

LISTING implies 132 characters per line, and XMP implies 80 characters per line. No character entities are processed. The only tag that is processed is the ending tag, "/LISTING" and "/XMP" respectively.

After PRE, any tag is recognized, and character entities are processed. There is no assumed number of characters per line, but that can be specified with the WIDTH attribute.

After LEGACY, any tag or character entity is allowed, but only if preceded by the trigger character, normally control-Z.

Units of Measure

Standard HTML is ambiguous about placement of text, images, etc. For instance, font size is indicated from "1" to "7", and bitmap widths use units of pixels. Print Wizard, however, is designed to allow precision, and pixel size varies from printer to printer.

For every numeric value entered in a tag, Print Wizard will assume a certain unit of measure. For instance, the tag

<FONT pointsize=12>

(which doesn't exist in standard HTML) assumes a unit of "point" (1/72 inch). Units can also be relative to the current setting. To make the pointsize 2 points larger, do

<FONT pointsize=+2>

A minus sign ("-") also works. Changes can also be specified in percentages:

<FONT pointsize=-25%>

Finally, many measurements allow you to specify units exactly, with a two-character code immediately following the number, such as:

<PAGESIZE x=8.5in>

Allowable units are:

pt = points (72 points = 1 inch)

pc = pica (1 pc = 12 pt)

in = inches

mm = millimeters

cm = centimeters

li = lines (based on current linespacing)

For many measurements, we have tried to make the assumed units compatible with standard HTML, which deals in dots or pixels of the screen. When translating this to the printer, we have to make some assumptions. We have tried to maintain a certain amount of compatibility with existing browsers, as well as with earlier versions of Print Wizard.

Print Wizard takes the following approach. Each document starts off with an assumption of a virtual pixel density of 120 dots per inch (DPI). This is similar to the density used by various browsers when they print. Thus a horizontal rule (HR) that has a WIDTH of 300, will be printed as 300 DOTS wide, or 2.5 inches. Similarly an image (IMG) with a WIDTH of 480, will be printed as 480 IMG-DOTs wide, or 4 inches.

If Print Wizard encounters a <PAGESIZE>; tag, which is non-standard HTML, it then assumes a DPI of 720, and a density for images (IMG-DPI) of 300. Thus bitmaps that are scanned at 300 DPI will print in true size, regardless of the printer's capabilities. Finally, within either the <PAGESIZE> tag or the <BODY> tag, DPI can be set with a DOTSPERINCH attribute, and IMG-DPI can be set with an IMGDOTSPERINCH attribute.

Thus if DPI is 720, then a DOT unit is 1/720 of an inch. Likewise, IMG-DPI determines the size of an IMG-DOT. If a tag places a rectangle at X=360, and DPI is 720, then the rectangle is placed 1/2 inch in from the edge of the page. Print Wizard figures all placements from the top or left edge of the paper, NOT from where they normally start printing.

Colors

Print Wizard recognizes the following colors for fonts, font backgrounds, and horizontal rules:

#rrggbb hex RGB value

GRAYxx gray scale from GRAY00 to GRAY99

GREYxx likewise

aqua

black

blue

fuchsia

green

lime

maroon

navy

olive

purple

red

silver

teal

yellow

cyan

magenta

white

Fonts

Print Wizard is generally designed to work with mono-spaced fonts, such as Courier New. Mono-spaced fonts are consistent with the focus on legacy print data, which generally relies on character spacing to align columns. Also, Courier New can contain many international characters, if those options have been installed on your Windows system.

Print Wizard also works best with scalable fonts, i.e., TrueType fonts. These fonts can be scaled precisely to get the necessary height and width.

It is possible, with the FONT tag, to specify ANY available font, but your results may not be acceptable. If you are using a dot matrix printer, you may want to specify a font that is built in to the printer, for faster printing. These fonts can be identified by doing a font selection in a Windows program, and looking for a printer icon beside the font. Again, though, if they're not scalable then that limits Print Wizard's flexibility.

Text can also be printed in any rotation, with <FONT ... ROTATION=n>. When ROTATION is not zero, Print Wizard does not advance the printing position ("cursor"), so you will always need to specify location afterward.

Some printer drivers may not handle international characters well. If you have trouble, open the printer's properties in Windows' control panel, and try different settings for font substitution and type of download. You might also try a different but similar printer driver, such as a LaserJet 4 driver for a LaserJet 5 printer.

Character Entities

In <PRE> mode, Print Wizard recognizes standard named values for character entities, such as "&lt;" for less-than ("<"), "&amp;" for ampersand ("&"), and also "&euro;" for the Euro character ("€" -- might not show on your PC).

It also recognizes characters coded numerically, such as "&#242" and "&#D242" (both decimal), and "&#H20AC" (hex). Numbers below 128 resolve to ASCII values. Numbers between 128 and 255 are in the ISO 8859-1 character set, which is essentially the same as Windows Latin-1. As in true HTML, numbers above 255 resolve to 16-bit Unicode characters.

Multilingual Printing

The ability to render Unicode means that you can specify and intermix characters in many languages.

When Print Wizard has to print a character outside the ASCII range, it will test the currently selected font to see if it contains that character. If not, particularly for characters with diacritics, it will try several approaches to rendering the character, including printing character and diacritic separately, printing alternate forms of the diacritic, and using an internal bitmap for the diacritic.

Print Wizard does not yet deal explicitly with bidirectional languages Arabic and Hebrew.

Rectangles

HTML has a feature called "horizontal rule", as <HR>. By specifying SIZE (height), WIDTH, COLOR, and OUTLINE, you can create a solid, hollow, or color-filler rectangle of any size. The OUTLINE is always black.

Print Wizard extends this with absolute positioning (X and Y), so you can place the HR any place on the page. With clever use of these, you can create grids and other forms.

Placing an HR will change the current printing position, so you may want to use a GOTO tag to begin printing text in a particular spot.

It is possible to print rectangles over each other, text over rectangles, etc.

Graphics

Print Wizard is able to print bitmaps (pictures) from files that are in BMP, GIF, or JPG format, as well as Windows metafiles (WMF) or enhanced metafiles (EMF), that are on the PC, a local area network, or a web or FTP server. Pictures are coded using the <IMG> tag. These can be sized with the HEIGHT and WIDTH attributes. A BORDER can be added (always in black).

If the filename (in the SRC parameter) does not contain a complete path, Print Wizard will look for it in a particular directory, generally the directory containing the data file. You can override this by using the BASE tag with the HREF parameter. You can also specify an assumed file extension, with the EXT parameter of the BASE tag. So, if early in the print job you specify

<base href=c:\mypix ext=".bmp">

then you can generate a picture with the tag

<img src=wally>

and Print Wizard will read the file "c:\mypix\wally.bmp".

With Print Wizard’s additional attributes (X and Y), graphics can be placed anywhere on the page.

Printing a bitmap will change the current printing position, so you may want to use a GOTO tag to begin printing text in a particular spot.

It is possible to print text over graphics.

Bitmap Form Overlays

A special treatment of bitmaps allows creation of a form overlay. The OVERLAY attribute in the <PAGESIZE> tag specifies a bitmap file, in GIF, JPG, or BMP mode, that can exist on either the PC or an Internet server. This bitmap is always scaled to fit the page. So you can scan a full-page form (using other software), save it as a GIF, JPG, or BMP, and instruct Print Wizard to print it as background on every page of a print job.

Note that bitmap overlays can also be used when faxing.

The overlay does NOT affect the position at which Print Wizard will begin printing text on the page.

PCL Form Overlays

If you are using a laser (or other) printer that understands PCL (Printer Control Language), and has the macro capability (such as an HP LaserJet III or higher), you can instruct Print Wizard to load a PCL document as an overlay to be printed on every page. With this method, unlike with bitmap form overlays, the data is sent to the printer only once, and the printer does the job of adding it to each page.

If the document contains more than one page, each page will be loaded into a separate macro, and those will be cycled for each page of printout. So if you load a 2-page overlay, then proceed to print some text, your first page of text will print on the first page of the overlay, second on second, and then your third page of text will print on the first page of the overlay, and so forth.

You can create the form file using any Windows program that allows you to print to a disk file, such as Word, Adobe Acrobat Viewer, or Netscape. Select the document you want to use as your form. Configure the program to print using an HP LaserJet III printer driver (which you may need to install on your Windows platform), and to print to file. Print the page(s) you’re interested in. When prompted for a filename make one up. Make sure the file ends up with a ".PCL" file extension (you may need to create it as ".PRN" and later rename it as ".PCL"). This completes creation of the overlay file.

To use the overlay file, simply reference it as an overlay. For instance:

<HTML><PAGESIZE OVERLAY="c:\mydir\myform.pcl"><body><pre>Text begins here...

Note that Print Wizard relies on the file extension to know how to process the file.

Barcodes

Print Wizard can internally generate a variety of barcodes, which can then be printed on nearly any printer, with a tag as simple as

<barcode src=1234>

Of course there are many kinds of barcode, and you’ll want to specify style, size, position, etc. The Reference section below lists all the parameters. But here are some special notes.

The kind of barcode is set with the STYLE parameter; default is CODE128.

The SIZE of the barcode is its height. If not specified, it will default to the current font height.

Print Wizard starts off assuming that BARWIDTH, the width of the narrowest bar or space, is .012 inches. On a low resolution printer, this may produce unreadable barcodes. Therefore, you may need to specify a larger value.

Some barcode styles have particular requirements, such as numeric data only or a particular length. If you don’t meet these requirements, Print Wizard may detect that and print a message on the page, in place of the barcode.

Some barcode styles can have a check character, which is used by the barcode reader to mathematically validate the barcode. You can tell Print Wizard to calculate and print this character with the ADDCHECKCHAR parameter.

Barcodes usually have one line of human-readable text also. This can be turned on or off with the CAPTION parameter. The font used for the caption can be specified with the FACE parameter; default is the same face being used for text.

Certain styles of barcode have optional features, such as bearer bars or tall guard bars. These can be turned on or off.

Bar codes can be rotated to 90, 180, or 270 degrees, with the ROTATION parameter.

Barcodes are printed in line with the text, unless placement is specified with X and/or Y. The horizontal (if not rotated) size of the barcode is calculated automatically from the BARWIDTH, the STYLE, and all the necessary elements of the barcode. The current printing position will advance based on the total width. However, if the barcode is rotated, final printing position is undetermined.

Once the format of the barcode (STYLE, SIZE, etc.) has been established, it will remain in effect for the duration of the print job. It is sometimes easier to establish this format once, at the beginning of the print job, by including a BARCODE tag that has no SRC parameter (and will therefore not print anything).

Print Wizard still retains an earlier approach to printing barcodes, using special barcode font files. If you need to use these, please contact Rasmussen Software.

Smart Print

Smart Print is an option in Print Wizard that allows you to print any type of file through Print Wizard that has a Windows File Association with it.

A file extension can be set up to include a "print" and a "printto" action within the Windows environment (Windows registry) that would allow you to print tthat file through some other default application, allowing that application to render the print job for you.

Print Profiles

Along with the various PWML mark-up language options, many of the numerous print options can also be set up in a "print profile".

Through the Print Wizard user interface you can create "print profiles" that are reuseable initialization files for various print tasks you may have. These print profiles can be called directly from the user interface, from the Print Wizard engine or used through Print Wizard services.

Here is a typical example from a client:

Print Wizard Server Edition is used to establish an LPD service. With LPD the customer builds a series of "printer queues" that will receive print jobs from their application on a LINUX host system.

Queue "CHECKS" prints on their H/P LaserJet 4500, bin 3 where checks are

Queue "A-INV" prints on their same Laserjet, but bin 2, loaded with plain paper. It prints a 3-part Invoice overlay (printing all 3 pages without the need for pre-printed forms) with the appropriate data merged.

Queue "B-INV" prints a single page overlay of the invoice with the data merged on the default printer.

Queue "PO" prints purchase orders with a PO overlay on the same default printer.

Queue "FAX" faxes the incoming print job to a specified fax number.

Queue "Email" generates a PDF of the incoming print job and emails it to a specified email address.

Queue "ARCH" generates a PDF for archiving with the overlay and places it in a specific directory.

Queue "SP" allows the host to send down non-Print Wizard specific print jobs and pass them through the Smart Print feature to print them. This includes Excel and Word documents stored on the server.

This is all controlled by the LPD service and a series of print profiles associated with different print queues. This also makes it possible to print even the multi-part job without the need for multi-part preprinted forms.

Additional information on using and building print profiles is available within the Print Wizard manual.

Conclusion

Print Wizard Personal Edition and Print Wizard Server Edition provide numerous print capabilities for printing and manipulating simple print jobs from legacy or remote sources. The Print Wizard package can be used to solve many complicated problems that allow you to concentrate more on the data thatn the print.

Copyright © 2024 Rasmussen Software, Inc. Legal Information & Privacy Policy
Send comments and suggestions to rsi@anzio.com