|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 Server 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. |
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, etc
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, duplexing, 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 |
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, topBitmap overlay
On any printer
Stretched to full page
BMP, GIF, JPGPCL5 overlay
On PCL5 printers, using printer's macro capability
On any printer, PDF, or fax using PCL translation
Can be multi-pageMetafile 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 selectionFont 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 7Text rotation
Any angle Text effects
Bold, italic, underline Text positioning
Subscript, superscript Text color
Black, white, red, etc.
By hex RGB value
GrayxxBackground 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 inlineLine
Horizontal, vertical, diagonal
Width, colorImage types
BMP, JPG/JPEG, GIF, WMF, EMF Image source
Local disk
Network disk
FTP, HTTP, or HTTPS serverImage 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
Print Wizard is a 32-bit Windows program. It runs on Windows 95, 98, ME, NT4, 2000, XP, and 2003.
Host-end modules are available for most Unix/Linux platforms.
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 Server 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.
Print Wizard is a print processing engine that runs on Windows (95 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), and as an integral part of AnzioWin, a telnet (terminal emulation) program also from Rasmussen Software. In addition, the Print Wizard product includes the MapiSend program (MAPISEND.EXE) which can programmatically send faxes using Print Wizard. Print Wizard also includes a program (PWLPD.EXE) that acts as an LPD/LPR handler, allowing Unix and other host systems to print on the PC's printer.
Print Wizard can process text that comes to it in a variety of ways:
Print Wizard can take as input:
Print Wizard can output:
Print Wizard solves a wide variety of printing problems:
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 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:
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 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 superseded by the spooler level).
The remaining sections describing Print Wizard's text handling do not apply to spooler mode.
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 overstriking 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.
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.
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 (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 "€" 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 "<" and change "&" to "&". 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.
Because Print Wizard exists in several forms, there are several ways to use it.
AnzioWin is our telnet (terminal emulation) program for Windows. More information can be found at our AnzioWin page.
We also have Anzio Lite, but it does not include the Print Wizard logic.
When Print Wizard is turned on in AnzioWin, it affects a) print screens, b) the PRINTFILE command, and c) passthrough print, sometimes called aux print, transparent print, or attached print. If you are unfamiliar with passthrough print, see our documents at the web site above.
If the program generating the printout on the host system has some capability for inserting escape codes for particular kinds of printers, try setting it for "generic" printer. This will allow Print Wizard's logic to control the printout.
With AnzioWin's normal menu system, the user can select several things that influence Print Wizard's operation, including:
The font size chosen (in Printer Font) does NOT affect Print Wizard output, since font size is automatic.
AnzioWin also allows you to have a print-initialization file, normally named "_prtinit.txt" which is inserted at the beginning of passthrough print jobs only.
The freestanding Print Wizard program is completely contained in the file PRINTWIZ.EXE. This is a console-mode program that ordinarily has NO user interface. It is driven completely by command-line parameters. Thus it can be initiated by another program, a desktop icon, a batch string, etc.
Print Wizard can be initiated to print a particular file, a group of files as specified by a wildcard, or any files that get dropped into a particular directory. It can receive files sent to a particular TCP/IP port, using the "net direct" protocol. It can even process and print files that exist on web or FTP servers. It can log its progress to the screen or to a disk file.
Printwiz.exe starts with an assumption that it should print in the Courier New font, on the Windows default printer. Properties such as paper size and orientation are taken from that printer's properties as set in the Windows control panel. Print Wizard also assumes that incoming text data is in the DOS (OEM) character set.
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:
The filespec can be
A filespec is NOT used if /vPORT is used.
Examples are provided below.
This is the mode where you simply tell Print Wizard to print a particular file. For instance, to 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.
To print a file from an FTP server:
printwiz ftp://somehost.com/pub/myfile.txt
Note that Print Wizard will do an anonymous connection to FTP.
Print Wizard can act as a despooler, in which it runs in the background, watching a particular directory (or other wildcard spec) for files which have been created there and released (closed). For each file, it will print it as indicated, and delete it. It can optionally wait until the Windows spooler reports that it is fully printed before deleting it. A typical use would be:
printwiz /k /w /d /l c:\spool\*.*
Note that if you're running an old DOS program under Windows, you may be able to configure the DOS program to "print to file" to a specified file name in the "c:\spool" directory, and thereby use Print Wizard to process your DOS program's output. If the program has some ability to drive different kinds of printers (inserting escape sequences), try configuring it to print to a "generic" printer, so Print Wizard can function fully.
If you add a "/r" parameter to the line above, Print Wizard will rename the file to a temporary, unique file name before printing (and then deleting) it. That way, if you start another print job during the time Print Wizard is printing the first print job, there will be no name collision.
Print Wizard can mimic one of the protocols used by many printer network interfaces, such as the JetDirect devices from HP. We call this protocol "net direct". In this method, a host computer writes print data to a particular IP address and port number. Print Wizard can monitor a port, process any data that is received there, and send the output to a printer. For instance, the command
Printwiz /vPORT=9100
Will cause Print Wizard to "listen" on port 9100, and route any print jobs received there to the Windows default printer.
See below for a description of the "netprint" program for Unix (-like) systems.
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". Also, this technique is necessary when you want to use Print Wizard to fax certain files (such as with MAPISEND, explained below).
To do this:
C:\printwiz\printwiz.exe /p"%2"
The "printto" action is what Windows uses to print a particular file type on a specified printer. The printer name will be inserted in place of the "%2", and the file name to be printed will be appended. For diagnostic purposes, you might want to add a log file designation.
When you turn on debugging mode (with "/vDEBUG"), Print Wizard will provide some very useful debugging information, such as what printer it is writing to, whether it detects escape sequences, etc. It will also tell you all the analysis it does in its attempts to "best-fit" the document to the page. And it will tell you if it finds any markup tags it does not recognize.
The Print Wizard package (but not AnzioWin) includes a program for various Unix (and similar) platforms, called "netprint". This program is designed to work with PRINTWIZ's "net direct" protocol. It will also work with HP JetDirect and similar devices. It takes piped input and sends it to a particular machine name (or IP address) and port (default 9100).
You will need to identify which netprint object is correct for your host system, by noting the file extension. For instance, the file "netprint.sco" in the "netprint.obj" directory is for SCO Open Server 5. Check the README.TXT file for other versions. Contact Rasmussen Software if you need netprint compiled on another system. Once you've identified your object, move it to the host system, such as with FTP. Be sure to transfer it as binary. Rename it, make it executable, and put it in your PATH; for instance:
mv netprint.sco netprint
chmod +x netprint
cp netprint /usr/bin
The print data must always be piped into netprint. For instance,
ls –l | netprint
will send a directory listing to netprint, with a default port number of 9100.
But what machine will netprint send the data to? The netprint program has a unique feature in that it assumes you want to send the data to the same PC you are logged in from in a telnet session. (To do this, netprint looks at the utmp or utmpx file in Unix.) This results in a form of "follow-me printing". Regardless of where I log in from, even with dynamic IP assignments, netprint will send the print job to my IP address, where PRINTWIZ can process it and send it to the correct printer.
Of course, you can also specify a particular destination machine. The complete syntax of netprint is:
netprint [options]
where options include
-p nnn use port number nnn
-h xxx send to hostname (or IP number) xxx
-d nnn set debug level to nnn.
The LPD/LPR protocol is a standard network protocol by which one computer on a network can print on another computer's printer. Most Unix, Linux, and similar systems, and Windows NT and 2000, can send print jobs out using this protocol. The PWLPD program, part of the Print Wizard package (but not part of AnzioWin), can serve as a print server for this protocol.
Configuring LPD/LPR on your host system will vary by platform. The end result is that the host system will send the print job out to a particular machine name (or IP number) and port (normally 515). The machine name/IP number has to match the PC that PWLPD is running on. The print job sent to the PC will also identify a "queue name", which tells PWLPD which printer to print this job on. More on that later.
Print Wizard is also provided as a callable module, PWDLL.DLL, that can be called from many programming languages, including Visual Basic (VB) and Visual Basic for Applications (VBA). This makes a very easy way to get basic or advanced printouts from these languages without delving into the Windows printer API. In fact, you can create printout with as little as one call.
The following VB subroutine shows the interface, and demonstrates the use of some:
Private Declare Function pw_configure_printer Lib "pwdll" (ByVal window As Integer) _
As Integer 'returns 1 if successful, else 0
Private Declare Function pw_print_text Lib "pwdll" (ByVal lpchar As String, _
ByVal count As Long, ByVal cs As Long) As Integer
'returns 1 if successful, else 0
'cs is 0 for ISO ' 1 for OEM
' 2 for other (no translation)
Private Declare Sub pw_flush Lib "pwdll" () 'terminates print job
Private Declare Sub pw_set_html_base Lib "pwdll" (ByVal lpchar As String)
'sets the html_base for relative filenamesPrivate Sub Command1_Click()
res = pw_print_text("This is a Print Wizard test", 27, 0)
pw_flush
End Sub
Note that all integers are 32-bit.
The MapiSend program (MAPISEND.EXE) is a command-line driven program to interface with Windows' Messaging API (MAPI), by which you can send emails and notably here, faxes. (This refers to OUR MapiSend program, not to one of the same name available from Microsoft.) Format is:
MapiSend [options] filename
where options can be
/n<note text>
/f<faxnumber>
/r<recipient>
/s<subject>
/e<email>
/p<profile>
Do not enter the brackets ("[", "]", "<", ">"). Use double-quotes if any item contains an embedded space.
The "/e" would not be used for faxing.
The "/p" is particularly important. By naming the MAPI profile, you can avoid having MAPI ask you any questions, so that fax output can be completely program-driven, without operator intervention.
For instance, to send Rasmussen Software an order form, do:
Mapisend /p"my profile" /f1-503-624-0760 order.txt
But wait! This assumes that Windows knows how to print the file "order.txt", based on its file extension ("txt"). You must tell Windows that information. See "Default print processor" above for instructions on how to do this.
A special feature in PRINTWIZ.EXE allows it automatically invoke MAPISEND to send a fax. To use this feature, insert a line at the beginning of the file, with a "!" followed by the MAPISEND command. For instance, make a file that contains:
!mapisend /f624-0760
<pwml><body><pre>Here is the first line of text
second line
Feed this file to PRINTWIZ by any of the usual methods. PRINTWIZ will inspect the first line, and note that it starts with "!mapisend". It will then copy the second and following lines to a temporary unique file, and execute the MAPISEND command as given (without the "!"). If everything is properly configured, MAPISEND will initiate the fax send, which will then invoke another instance of PRINTWIZ to render the data to the fax device. PRINTWIZ will delete the temporary file when finished.
This technique can not be used from AnzioWin.
Note that this technique can also be used with the despooler approach described above. So PRINTWIZ can stay alive in the background, watching a particular directory. When a file is dropped into there by some other process in the system, PRINTWIZ will process it and, if it contains the initial command line as above, will fax it to its designated recipient.
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.
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.
Print Wizard detects marked-up data as a file starting with any of (case insensitive):
<!DOCTYPE
<HTML
<PWML
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.
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.
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.
Print Wizard recognizes the following colors for fonts, font backgrounds, and horizontal rules:
#rrggbb hex RGB valueGRAYxx 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
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.
In <PRE> mode, Print Wizard recognizes standard named values for character entities, such as "<" for less-than ("<"), "&" for ampersand ("&"), and also "€" for the Euro character ("€" -- might not show on your PC).
It also recognizes characters coded numerically, such as "ò" 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.
Following is a complete list of the named character entities that Print Wizard recognizes. Note that names are case sensitive:
quot "
amp &
lt <
gt >
euro, Euro €
nbsp non-break space
iexcl ¡
cent ¢
pound £
curren ¤
yen ¥
brvbar ¦
sect §
uml ¨
copy ©
ordf ª
laquo «
not ¬
shy
reg ®
macr ¯
deg °
plusmn ±
sup2 ²
sup3 ³
acute ´
micro µ
para ¶
middot ·
cedil ¸
sup1 ¹
ordm º
raquo »
frac14 ¼
frac12 ½
frac34 ¾
iquest ¿
Agrave À
Aacute Á
Acirc Â
Atilde Ã
Auml Ä
Aring Å
Aelig Æ
Ccedil Ç
Egrave È
Eacute É
Ecirc Ê
Euml Ë
Igrave Ì
Iacute Í
Icirc Î
Iuml Ï
ETH Ð
Ntilde Ñ
Ograve Ò
Oacute Ó
Ocirc Ô
Otilde Õ
Ouml Ö
times ×
Oslash Ø
Ugrave Ù
Uacute Ú
Ucirc Û
Uuml Ü
Yacute Ý
THORN Þ
szlig ß
agrave à
aacute á
acirc â
atilde ã
auml ä
aring å
aelig æ
ccedil ç
egrave è
eacute é
ecirc ê
euml ë
igrave ì
iacute í
acirc î
iuml ï
eth ð
ntilde ñ
ograve ò
oacute ó
ocirc ô
otilde õ
ouml ö
divide ÷
oslash ø
ugrave ù
uacute ú
ucirc û
uuml ü
yacute ý
thorn þ
yuml ÿ
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.
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.
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.
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.
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.
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.
The following table indicates all the tags and parameters that Print Wizard recognizes. Items marked with "+" are extensions to the HTML standard. Where units of measure are involved, the table shows what unit is assumed; see above for explanation. The table also indicates when relative or percentage changes are allowed, and where exact units can be specified.
<HTML> ... </HTML>
<PWML> ... </PWML>
<HEAD> ... </HEAD>
(ignored)
<PAGESIZE> +
DOTSPERINCH
establishes DPI and DOT
IMGDOTSPERINCH
establishes IMG-DPI and IMG-DOT
X=n
in DOTs
relative, %, units
Y=n
in DOTs
relative, %, units
PAPER=n
1=letter
3=tabloid
5=legal
8=A3
20=#10 envelope
BIN=n
1=upper
2=lower
3=middle
4=manual
5=envelope
6=envelope manual
7=auto
8=tractor feed
ORIENTATION=s
1 or "landscape"
0 or "portrait"
LENGTH=n
lines per page
LINESPACING=n
vertical, DOTs
relative, %, units
OVERLAY=filename
always printed at full page size
DUPLEX=xxx
VERTICAL
Binding on left edge
HORIZONTAL
Binding on top
OFF
<BASE>
HREF=s
base location for images
EXT=s +
assumed extension for IMG files
<BODY> ... </BODY>
DOTSPERINCH +
establishes DPI and DOT
IMGDOTSPERINCH +
establishes IMG-DPI and IMG-DOT
TOPMARGIN=n
in DOTs
relative, %, units
BOTTOMMARGIN=n
in DOTs
relative, %, units
measured from top edge of paper
LEFTMARGIN=n
in DOTs
relative, %, units
RIGHTMARGIN=n
in DOTs
relative, %, units
measured from left edge of paper
COLUMNOFFSET=n +
in DOTs
units
COLUMNGUTTER=n +
In DOTS
units
<LISTING> ... </LISTING>
implies 132 characters per line
no embedded tags
no character entities
<XMP> ... </XMP>
implies 80 characters per line
no embedded tags
no character entities
<PLAINTEXT>
no tags can follow, not even </PLAINTEXT>
no character entities
<PRE> ... </PRE>
can contain tags
can contain character entities
WIDTH=n
characters per line
<LEGACY> ... </LEGACY>
can contain tags prefixed by trigger
can contain character entities prefixed by trigger
TRIGGER=n
Describes the trigger character in decimal
<FONT>
FACE=s
Windows font name
SIZE=n
1 through 7, arbitrarily assign to point sizes
relative, %, units
affects linespacing
POINTSIZE=n +
exact height in points
relative, %, units
affects linespacing
PITCH=n +
in DOTS
relative, %, units
forces horizontal spacing of characters
LINESPACING=n +
in DOTS
relative, %, units
ROTATION=n +
0, 90, 180, 270
COLOR=xxx +
Colors listed elsewhere
BACKGROUND=xxx +
Colors listed elsewhere
<SUP> ... </SUP>
Superscript
<SUB> ... </SUB>
Subscript
<GOTO> +
X=n
in DOTs
relative, %, units
accounts for unprintable area
specifies left side of character cell
Y=n
in DOTs
relative, %, units
accounts for unprintable area
specifies top of character cell
SAVE=X
SAVE=Y
RESTORE=X
RESTORE=Y
<B> ... </B>
bold on/off
<U> ... </U>
underline on/off
<I> ... </I>
italics on/off
<BR>
Break line
<HR>
horizontal rule or rectangle
SIZE=n
height in DOTs
relative, %, units
WIDTH=n
in DOTs
relative, %, units
COLOR=xxx
Colors listed elsewhere
OUTLINE=n
width of outline, in DOTs
relative, %, units
always black
X=n +
in DOTs
relative, %, units
accounts for unprintable area
defaults to centered on page
Y=n +
in DOTs
relative, %, units
accounts for unprintable area
defaults to next line
<IMG>
SRC=s
file name, with forward slashes
can be URL
affected by BASE .. HREF, EXT
currently supports BMP, JPG, GIFm WMF, and EMF formats
ALIGN=s
top
top of image to top of text
middle
middle of image to baseline of text
bottom
bottom of image to baseline of text
default
BORDER=n
DOTs
relative, %, units
HEIGHT=n
in IMG-DOTs
defaults to bitmap’s height
WIDTH=n
in IMG-DOTs
defaults to bitmap’s width
HSPACE=n
horizontal space around image
in DOTS
relative, %, units
X=n +
in DOTs
relative, %, units
accounts for unprintable area
defaults to right after last text
Y=n +
in DOTs
relative, %, units
accounts for unprintable area
defaults to next line
<BARCODE> +
STYLE=s
UPCA
UPCE
EAN13
EAN8
2OF5
CODABAR
CODE11
CODE39
CODE93
CODE128
CODE128B
FACE=s
Windows font name for caption text
does not affect normal text
POINTSIZE=n
in points
relative, %, units
SIZE=n
in points
relative, %, units
X=n
DOTs
relative, %, units
specifies left edge
Y=n
DOTs
relative, %, units
specifies top edge
SRC=s
String to be barcoded
SUPPLEMENT=s
String for barcode supplement
BARWIDTH=n
inches
relative, %, units
defaults to .012"
BEARERBARS=b
OFF or ON
TALLGUARDBARS=b
OFF or ON
CAPTION=b
OFF or ON
SHOWGUARDCHARS=b
OFF or ON
ADDCHECKCHAR=b
OFF or ON