home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_GEN
/
THEPRN14.ZIP
/
PRINTER.DOC
< prev
next >
Wrap
Text File
|
1994-01-15
|
91KB
|
2,107 lines
---------------------------------------------------
-----------------------------------------------
-------------------------------------------
---------------------------------------
-----------------------------------
-------------------------------
---------------------------
-----------------------
-------------------
---------------
The Printer (tm) by Rob W. Smetana
and Pro~Formance
---------------
-------------------
-----------------------
---------------------------
-------------------------------
-----------------------------------
---------------------------------------
-------------------------------------------
-----------------------------------------------
---------------------------------------------------
The Printer (tm)
** Version 1.4 (1/94) **
Printer codes for hundreds of printers, that any programmer can use!
Includes demo code for C, Pascal, Microsoft BASICs and PowerBASIC.
=====================================================================
Copyright (C) 1989-1994, Rob W. Smetana All Rights Reserved
132 Alpine Terrace San Francisco, CA 94117 (415) 863-0530
The Printer, PDT, Pro~Formance and P~F are Trademarks of
Rob W. Smetana
=====================================================================
=====================================================================
Packing List
=====================================================================
PRINTER DOC This manual
CATALOG DOC A summary of our many programs
TO-ORDER DOC An order form
PRINTER EXE The Printer itself (database PLUS menu)
EDIT EXE For users to edit or add printer codes
AFTER they've selected a printer.
PRINTER CFG The printer codes for the printer YOU
selected. Your programs need ONLY deal
with this 1, small file!
* Created by Printer.Exe
* Read by Edit.Exe (and the demo programs)
DEMO EXE Reads Printer.Cfg and uses it's information
to format text on YOUR printer.
BE SURE to run Printer.Exe first and select
a printer that's compatible with YOUR printer.
PRINTER DAT A "structure file" used by our PDT program
to help you view and edit printer code
data files.
This file, together with The_Prn.? files
(see below) also explain the record
structure of printer code data files.
The next "pairs" of files -- for PASCAL, C
and BASIC -- provide the record structures
(The_Prn.?) and demo code.
THE_PRN PAS Structure/Type declarations
DEMO_PRN PAS Demo
THE_PRN C Structure/Type declarations
DEMO_PRN C Demo
THE_PRN BAS Structure/Type declarations
DEMO_PRN BAS Demo
=====================================================================
THE PRINTER: Eliminating a Programmer's Nightmare
=====================================================================
Our objective in developing The Printer was to help eliminate a
nightmare many programmers face: printing formatted text on dif-
ferent printers, with each printer requiring different instructions
(ie., different printer codes).
* If you want bold here, italics there, this phrase underlined,
etc., you need the printer codes to "turn on" these options.
* And if you distribute your programs, you'll often need printer
codes for the dozens (or hundreds) of different printers your
users have -- unless you want to limit your audience!
Few programmers have the time and resources to obtain appro-
priate codes for every printer. Fortunately, you don't have
to: The Printer offers you codes for hundreds of printers.
* And with The Printer, you can, in many cases, develop simple print
routines you can use REGARDLESS OF WHICH PRINTER A USER SELECTS!
* Finally, ANY programmer writing in ANY language can use The Printer.
If you can read a fixed-length record, you can use The Printer.
The Printer contains printer codes for over 720 different printers
(over 160 in user-supported versions). For each printer, we al-
located space for about 70 printer codes. Some of these are blank,
"user" codes -- so you (or your users) can customize codes for
specific needs, or we have room to expand into.
Examples: Here's how The Printer can help.
-------------------------------------------
In this package you'll find PRINTER.EXE -- a multi-purpose program
and printer database in one. You (or your users) can use Printer.Exe
to install a printer. And YOU can use it to expand the printer code
database to its fixed-length format -- which you can then view and
edit (more on this later). When used with your programs : : :
* Just run Printer.Exe and select a printer from the menu. You
can then review and edit the printer codes for that printer.
* When you're satisfied with the codes you see, press F2 and
we'll save to disk a small configuration file: PRINTER.CFG.
Your programs need only deal with PRINTER.CFG! It'll contain most
every printer code you'll need. To enable or turn on a printer
feature, just print the appropriate "field." For example:
continued . . .
Examples (continued)
Note:
* Our examples use BASIC code for its simplicity. If you program
in other languages, mentally translate these simple examples.
* Our examples assume we already read Printer.Cfg using a structure
or TYPE called "Printer." The file The_Prn.? has the complete
record format of Printer.Cfg.
* Our examples use "rtrim$," a BASIC function that trims trailing
spaces from strings. Each printer code is allocated 14 bytes
even though some codes are 1-3 bytes. Trimming the trailing
spaces ensures we don't shift text right by printing excess spaces.
To reset the printer: lprint rtrim$ (ThePrn.Initialize);
To print Text$ in bold: lprint rtrim$ (ThePrn.BoldON); Text$;
and back to normal: lprint rtrim$ (ThePrn.BoldOFF)
To Underline Text$: lprint rtrim$ (ThePrn.UnderlineON); Text$;
and back to normal: lprint rtrim$ (ThePrn.UnderlineOFF)
That's it. It's that simple! While there are many variations on
this logic (like loading codes into an array, then printing already-
trimmed array elements), the simplicity remains.
And if your user installs a different printer, your code need NOT
change. Just read Printer.Cfg, with the codes for the new printer,
and proceed as usual!
=====================================================================
Packing List
=====================================================================
If you have any questions about anything here, give us a call at
(415) 863-0530. A few minutes on the phone could save lots of time.
File Description
----------- ------------------------------------------------------
Printer.Exe. A multi-purpose program AND database that:
* You may distribute along with your programs (if you
wish) -- provided you have the registered version.
* Compresses the printer database by about 85 percent.
* Allows users to:
- Select a printer from a menu.
- Review and edit printer codes.
- Save a small configuration file (Printer.Cfg)
to disk with codes appropriate for their printer.
YOU need only deal with this small "configuration
file" to get all the information you'll need to
drive your user's printer (for the most part).
* Lets YOU expand the database to its full, fixed-
record size and format. You may then view and edit
it (using our PDT which we'll describe later?).
Edit.Exe A program you may, if you wish, distribute with your
programs. When you use Printer.Exe to select a printer,
it saves to disk a small printer "configuration file."
Should your users ever want to edit these printer codes,
Edit.Exe is a small, fast way to do it.
Printer.Dat This is a "PDT structure file" that, together with
The_Prn.?, explains the field structure of the fixed-
length files The Printer can create.
"PDT" (the Pro~Formance Data Tool), is a terrific
program that's ideally suited to viewing and editing
data files. We could not have developed The Printer
without PDT. Section III describes PDT more fully.
The_Prn.? "Include files" (or units) containing TYPEs (structures)
for both fixed-length files The Printer creates.
Demo_Prn.? Demo programs ("?" = .BAS, .PAS or .C) showing how
to read Printer.Cfg and display printer codes. Some-
thing like this could prove useful in your programs.
====================================================================
A WORK IN PROGRESS
====================================================================
We consider The Printer a "work in progress," awaiting your feedback.
If you find The Printer useful, or if you think it **could** be
useful but isn't now, PLEASE take a moment and jot down some ideas
to help shape the future of this effort. We, and other programmers
we spoke with, are convinced this effort is worthwhile. But we're
not yet sure which format to distribute printer codes in, and which
tools to offer. Please help us shape the destiny of The Printer.
Here are some issues we'd like your feedback on.
* Printer.Exe can expand its compressed database into a fixed-
length file -- so you can view and edit it, add or delete
printers, add printer codes, etc. But currently, there's
no way to re-compress the fixed-length file and re-create
Printer.Exe. How valuable would that option be?
* Printer.Exe lets users edit and add printer codes. Should it?
* Printer.Cfg is saved as a fixed-length file. In this form
one can easily use a TYPE or structure to read all codes in
one gulp. But other formats could work as well: delimited,
sequential, etc. All have advantages; which is preferable?
* Some printer codes must be sent in a specific sequence.
But a database, by itself, offers no clues as to the proper
sequence. Would "Notes From The Trenches" help? Can you
offer tips for printers you're familiar with?
* The Printer contains no graphics-oriented printer codes since,
by themselves, graphics codes without other information can
be close to useless. Would a related product would help?
* What about newly-added printers? Manufacturers release new
printers every year. How can we best keep you up to date?
* When printer codes are saved to Printer.Cfg, they're space-
padded to 14 bytes each. Is this format easily usable in
all programming languages?
* Some codes contain Null (Chr$(0)). Is this a problem?
* What tools would be useful in a "professional" package? To
make The Printer accessible to all programmers regardless of
their means, we've considered offering two registered versions:
- A "plus" version with the basics.
- A "professsional" version with optional features (like
the ability to edit codes and re-create Printer.Exe).
Reactions? Features? Options?
=================================================================
CONTENTS
=================================================================
The rest of this manual is organized into 10 short sections:
Section I: Copyrights, License, Disclaimer, Registering,
Distributing The Printer
Section II: Installing The Printer; Quick Start
Section III: Introducing PDT -- a "Must Have" for Programmers
Section IV: What You MUST KNOW to Use Printer Codes
Section V: Using Printer.Exe -- Use #1, Selecting a Printer
Section VI: Using Printer.Exe -- Use #2, Expanding the Database
Section VII: Using Printer Codes with "Placeholders"
Appendix I: The Record Structure of The Printer's Data Files
Appendix II: Using PDT to View and Edit ANY File
Appendix III: Registering and Ordering
=================================================================
=================================================================
Section I: Copyrights and Trademarks
=================================================================
For information, contact: Rob W. Smetana
Pro~Formance
132 Alpine Terrace
San Francisco, CA 94117
(415) 863-0530
The Printer is Copyright 1989-1994, Rob W. Smetana
All Rights Reserved Worldwide
The Printer, The Pro~Formance Data Tool and PDT are Trademarks
of Rob W. Smetana
LaserJet is a Trademark or Hewlett-Packard Corp.
Other trademarks belong to their respective trademark holder.
=================================================================
Disclaimer and Limited Warranty
=================================================================
We've made every effort to ensure the reliability and accuracy
of this product. If you find errors in this material, or if you
have comments, suggestions or requests, please contact us immedi-
ately. But neither Rob W. Smetana nor Pro~Formance can assume
any liability for damage that occurs because of usage of or
reliance on this product.
We warrant that any disks we send you will be free from defects
in materials or workmanship for a period of 30 days from the date
shipped.
THIS SOFTWARE AND ALL ACCOMPANYING MATERIAL(S) ARE OFFERED AS-IS.
EXCEPT FOR THE WARRANTY DESCRIBED IN THE ABOVE PARAGRAPH, THERE
ARE NO WARRANTIES EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
TO, IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PAR-
TICULAR PURPOSE, AND ALL SUCH WARRANTIES ARE EXPRESSLY AND SPECIFI-
CALLY DISCLAIMED.
IN NO EVENT SHALL Rob W. Smetana and/or Pro~Formance BE RESPONSIBLE
FOR ANY INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS,
EVEN IF Rob W. Smetana and/or Pro~Formance HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Information contained herein and in the printer database is subject
to change without notice and does not represent a commitment on the
part of Rob W. Smetana and/or Pro~Formance.
=================================================================
License and Non-Disclosure Agreement
=================================================================
Running Printer.Exe, using anything in this package, or registering
for The Printer indicates your understanding and acceptance of the
license and warranty herein.
The software and printer code database described in this document
are furnished under a license agreement. The software and database
may be used only in accordance with the terms of that agreement.
* No work derived from this material may be distributed in any
form if it substantially or in part duplicates the functionality
and/or objectives of The Printer and the printer database.
* REGISTERED USERS: This product is licensed to you alone. You
may make copies solely for the purpose of reasonable back-up of
this package. You agree not to copy or transmit this material
for any other purpose, except as provided for below, and further
agree not to make it available to others through a network
configuration.
* REGISTERED USERS may use materials included here, and distribute
Printer.Exe and Edit.Exe to clients and users of programs or code
you've written, PROVIDED THAT:
- You do NOT distribute, or allow to be distributed, the expanded,
un-encrypted printer code database, or any significant portion
thereof. By "significant" we mean 10 records or more.
- You do NOT reveal to anyone the "password" required to expand
the compressed, encrypted database.
* REGISTERED USERS: Should you distribute, to users of programs you
have written, your own version of the printer database, you agree to:
- Encrypt the database such that no other person or program,
save yours, can access it.
- Not disclose to anyone the method(s) used to encrypt or
de-encrypt the database.
- Allow users of your programs access only to that reasonable
portion of the database that serves their immediate needs.
While it would be considered reasonable for a specific user
or network to need access to printer records for 1-3 dif-
ferent printers simultaneously, it would be unreasonable
to allow simultaneous access to 10 printer records or more.
* SHAREWARE VERSIONS may be used for 90 days so you may thoroughly
evaluate how The Printer may serve your needs and those of your
users. But you may not distribute any part of The Printer in any
way except as provided for in "Distributing The Printer."
=================================================================
Distributing The Printer
=================================================================
Shareware distributors, bulletin boards and user clubs may
distribute "user-supported" (or shareware) versions of this
software provided that:
* Your company name, literature, etc. do not promote or
include the words "freeware" or "free" software -- which
terms misrepresent "user-supported" software. Expressly
prohibited from distributing any software by Pro~Formance,
Rob W. Smetana and/or Brandon S. Smetana are: American
Freeware, California Freeware and U.S. Freeware.
* You include, unmodified, all files included with this
software including:
Printer.Exe, Printer.Doc, Edit.Exe, Printer.Dat, The_Prn.?,
Demo_Prn.? and any other files mentioned in Readme.Bat or
Packing.Lst.
* You charge a "distribution fee" of no more than $8 (US).
* You clearly state that continued use of "user-supported"
software REQUIRES paying for the software.
=================================================================
The Benefits of Registering; How we "Say Thanks"
=================================================================
The Printer is NOT free software. It is neither "public domain"
software nor "freeware." It is "user-supported" shareware.
This software is Copyright 1989-1994, Rob W. Smetana. It is
protected by both United States copyright law and international
treaty provisions.
Shareware versions of The Printer work just like fully registered
versions except that:
* Shareware versions of Printer.Exe and Edit.Exe remind you that
they're unregistered and may not be freely distributed.
* Shareware versions contain printer codes for over 160 of the
most popular printers. To "say thanks" to those who register,
we send them a database with over 700 printers.
* All versions include an option to expand the database to a
fixed-length version (so you may view and edit it). Shareware
versions will write out about 50 records so you'll be able to
clearly see how the full database may be viewed and edited.
To Register Instantly:
----------------------
Call (415) 863-0530 with your VISA or MasterCard number.
* This can cut 2-3 weeks off delivery time, since we needn't
wait for your order to arrive by mail, and we don't have
to wait 10 business days for checks to clear the bank.
To Register by Mail:
--------------------
Just fill out the order form at the back of this manual.
* PLEASE NOTE that, because we offer so many programs, our
order form has 2 pages.
- Page 1 lists each program and the cost of each.
- You fill in page 2, indicating which program(s) you'd like
to order, and adding your name, address, credit card
information (if appropriate) and so forth.
* Mail your order form to:
Pro~Formance 132 Alpine Terrace San Francisco, CA 94117 USA
=================================================================
Section II: Installing The Printer; Quick Start
=================================================================
Installing The Printer
----------------------
Copy these files to any path: (only Printer.Exe is required)
Printer.Exe, Edit.Exe, The_Prn.?, Demo_Prn.?
If you plan to expand the database to it's fixed-length format, we
strongly urge you to get a copy of PDT to help view and edit it. If
you do install PDT, be sure to copy Printer.Dat to PDT's special sub-
directory: PDT.DIR. If you do, whenever you run PDT and open the
fixed-length database, PDT will be able to automatically format your
view of the database in logical rows and columns. See Appendix II.
Quick Start
-----------
We know you're anxious to begin, so try both of these. Then, BE
SURE to read this manual later -- with information you MUST KNOW!
* Select a printer:
- Run Printer.Exe. The bottom of your screen will always have
instructions on what you should do next.
- Highlight a printer and press <enter> to "select it."
- Review the printer codes for that printer; edit any you care to.
- Press F2 to save your printer codes to Printer.Cfg.
- Press F10 twice to exit to DOS.
Now review Printer.Cfg -- using PDT or Demo_Prn.? that we included.
Or use The_Prn.? or Printer.Dat as the basis of a program you
write to review or try out the printer codes.
* Expand the database to it's fixed-length format:
- Ensure there's enough disk space for Printer.Dat: about 800k
with registered versions; about 50k with shareware versions.
- Run Printer.Exe like this:
printer rws-54321 <enter>
With registered versions, replace "serial #" with the serial
number we sent you with your registered version. And share-
ware versions will write out about 50 records to give you a
feel for all features of The Printer.
Now review Printer.Dat. Here's where PDT comes in v-e-r-y
handy -- especially if you installed the PDT "structure file"
(also called Printer.Dat) in PDT's special subdirectory.
=================================================================
Section III: Introducing PDT (the Pro~Formance Data Tool)
=================================================================
We've mentioned PDT before. And we'll mention it again, simply
because it's the finest tool we've ever seen to view and edit ANY
file -- especially fixed-length files like Printer.Dat, Printer.Cfg,
dBase files, and random record files produced by any language. We
could not have developed The Printer without PDT.
Here's a brief overview of PDT. Appendix II explains how to use PDT
to view/edit The Printer's files as well as other files you may have.
* With PDT you can view and edit ANY type of file: dBase files,
other types of data files, executable files (eg., .Exe or .Com
files), EBCDIC files, ASCII files, font files -- any file.
* You can view and edit ANY SIZE file -- up to two gigabytes! Jump
from the top to the bottom of any size file instantly. And you
can open up to 4 files at once. View and compare different files.
Or work in different areas of the same file. Since each file can
be up to two gigabytes in size, you can work with up to 8 giga-
bytes of data at once!
* You can manage database files like you've never been able to
before. PDT offers unique features to help you manage dBase
or ANY fixed-length record file (data or font files, etc.).
- PDT detects dBase ".DBF" files, formatting your "view" of
them so fields are automatically formatted out for you.
- With other fixed-length data files (like those created by
programs written in C, Pascal, BASIC, COBOL, etc.), PDT
lets you easily and quickly define their "structure."
- Once PDT knows the structure of a file, you'll be able to:
-- Easily view and edit the file, tabbing quickly from
field to field. You can even press a key to edit
numeric fields stored in "packed binary" form.
-- Mark blocks (either columns or records) and then:
Export them, Copy them, Erase or Fill them, etc.
-- Expand or Shrink the width of fields. And, if you
like, PDT will automatically update the dBase header
and its own "structure" files to reflect the change.
* PDT even manages EBCDIC files -- like those found on, or
downloaded from, large IBM computers.
* PDT can also help you:
- Repair files -- regardless of their type or size.
- Determine a file's structure (record or field length, etc.).
- Edit executable files (customize messages, options or serial #s).
=================================================================
Section IV: What You MUST KNOW to Use The Printer Codes
=================================================================
Slots for 70 Printer Codes
--------------------------
For each printer we've reserved 70 "slots" for printer codes. About
17 of these are "expansion" or "user" slots. You can use these to
add codes specific to programs you write. Or your users can custo-
mize codes to suit their specific needs. And if we later add codes,
we'll have room to expand into without disturbing what exists.
Codes are Stored as Strings
---------------------------
Printer codes are stored in string (or binary) format. You don't
need to parse or decipher codes like 027, 064, 018. And instead
of 11 bytes these codes would consume, we need only 3. But, if
you expand the printer database to its fixed-length format (or if
you look at Printer.Cfg) you'll find each printer code has been
allocated 14 bytes -- the code plus trailing spaces (ASCII 32).
This fixed-length structure simplifies editing, especially with PDT.
In most cases, to use a printer's features, just send a code to the
printer as-is -- after trimming off the trailing spaces. Be sure to
trim ASCII character 32 only (see below). For example, to turn
Italics on, a BASIC programmer might just read Printer.Cfg (using a
TYPE or structure) and then:
LPRINT RTrim$ ( ThePrn.ItalicsON ).
Beware Character 0
------------------
Some codes contain or end with ASCII character 0. It's CRITICAL
that you don't interpret this Nul character as white space and
trim it -- the code is meaningless without it. BASIC programmers:
* DO use BASIC's RTRIM$ to trim blanks (Chr$(32)) from codes.
* Do NOT use functions like Crescent Software's qpRTRIM or
pdqRTRIM. Crescent's functions trim BOTH character 32 AND
character 0 -- which could render some codes worthless!
Note: Epson printers often accept printer codes in two different
formats such as: "Escape + Chr$(#)" or "Escape + #" ("#" = a number).
We've heard rumors some Epson compatibles dislike the 2nd format; so
we standardized on the 1st. This renders such codes a little harder
to maintain and edit (although PDT lets you enter any ASCII character).
Placehoders (ASCII character 251: √)
-------------------------------------
While you can use most printer codes as-is, a few codes require that
you "fill in the blanks." Actually, you'll replace "placeholders"
with appropriate code(s).
For example, for most printers the database contains codes to switch
to 6- or 8-lines-per-inch (8-LPI). But suppose your program needs
finer precision -- you need to move down the page 3/60 of an inch.
("<" stands for ESCAPE -- ASCII character 27.)
* An Epson "Alternate Line Spacing" code might look like: <A√
* The comparable code for LaserJets might look like this: <&a√V
In both cases you'd scan for our placeholder (ASCII 251 or √), and
replace it with "3" for Epson LQ printers, or "36" for LaserJets.
(Lasers use 1/720 as the unit of motion for this code, Epsons 1/60).
This obviously requires that you know the units of measurement or
the formulas needed to calculate variables. We'll provide some of
these later.
You can decide to use these codes or ignore them. Here are some
codes that may require that you replace placeholders with variables:
Select Character Sets
Select Master Font
Variable Line Spacing
Alternate Variable Line Spacing
Page Length: Inches
Page Length: Lines
Set Tab Stops
Set Top Margin
Set Bottom Margin
Set Left Margin
Set Right Margin
Absolute Move to a Vertical Location
Relative Move to a Vertical Location
Absolute Move to a Horizontal Location
Relative Move to a Horizontal Location
Some Codes are Blank Opportunities for your Users
-------------------------------------------------
There are many "families" of printers: dot matrix, laser, "daisy-
wheel," Postscript (which we did not include), etc. Certain types
of printer codes are relevant for some families but not others.
For example, dot matrix printers offer "draft" and "near letter
quality" options. Other families have no comparable option. Sim-
ilarly, laser printers let you save (push) the cursor position,
jump somewhere else on the page to do something, then restore (pop)
the cursor and continue where you left off. Character- or line-
oriented printers (eg., dot matrix) offer nothing comparable.
The point is that for EVERY printer, some "slots" will be blank --
a consequence of combining different families into one database.
But as long as your users use Printer.Exe to "install" a printer,
THEY can fill in these blanks (or not) as they see fit. Then, if
they turn on options, it's their responsibility to ensure a printer
code exists for them. If it's blank, nothing will happen.
One reason we mention this is that if you run Printer.Exe and select
a printer to review, you should EXPECT that at least 20 of 70 codes
will be blank. Of these 20+, 17 or so are "user" codes.
LaserJet Font Codes
-------------------
Because we combined different families of printers into one
database, we had to make some compromises.
We settled on 14 bytes for each printer code after carefully
reviewing the widths of thousands of codes. But we knew this
would truncate some Hewlett-Packard codes -- particularly those
specifying LaserJet and DeskJet fonts. Not to worry . . .
We've learned from experience that to switch fonts on LaserJets,
one should be v-e-r-y specific. That's because lasers may have 2 or
more fonts which share **some** attributes. If you want, say,
condensed print (17 pitch), be sure to specify which one: fixed/
proportional, medium/bold, upright/italic, Line Printer/Times Roman,
etc. If you don't, you're in for some surprises.
To select fonts, one should specify Orientation, Fixed/Proportional,
Symbol Set, Pitch, Height, Style, Stroke Weight and Type Face. This
can be done with a code like this ("<" = Escape)
<(10U<(s0p10h12v0s0B<(s3T
That's 25 characters -- which we don't have room for. But you CAN
accurately specify fonts. Just send 2 or more of the codes we
provide (some may have "placeholders"). In this case you'd send:
* Select Character Set (<10U) * Select 10 pitch
* Bold ON * Select Type Face (<(s3T)
Origin(s) of this Printer Database
==================================
When we originally considered developing this database, we asked
other programmers to contribute by sending us disks or E-Mail with
their offerings.
A handful of people contributed, most of whom sent paper (copies of
manuals, books, etc.). They realized, like we did, that typing
printer codes is time-consuming, boring, tedious and potentially
error-filled.
We didn't want to manually enter this stuff either. And we weren't
satisfied with the number of printers we had. So we looked around
for existing databases. We found several, merged them together,
then used what contributors sent to:
* Verify what we had.
* Fill in the gaps (missing printers or missing codes).
* Reconcile inconsistencies between 2 or more sets of codes for
the same printer.
Special Thanks to Rick Pedley and Matt Pritchard
------------------------------------------------
Rick sent us codes for hundreds of printers. Matt sent, direct from
Epson and Toshiba, summaries of printer codes for dozens of the most
popular printers.
These were invaluable! Without them, we could not have reconciled
the many inconsistencies we found among codes for the same printer
(from different databases).
A Work in Progress; Bugs and Their Ilk
======================================
Like many good programs, this database may never be finished.
There will always be printers to add. And there are many holes --
printers for which we have few codes (some have just 2-3 codes).
And what can I say. There are bound to be bugs in this database
(although in 2 years, nobody has mentioned any).
If you find errors, if you can fill in missing codes, or if you add
printers, please send them to us -- ON DISK. You can use PDT to
create new/modified records in the proper format. Then just use
PDT's Block Mark and Block Export features to export new records to
disk and send them to us (or call us to upload your contributions).
Industry Standardization Will Help the Next Generation(s)
=========================================================
One of the things that makes this database so valuable (and so
tedious to manage) is that printer manufacturers have used so
many different (read, proprietary) ways to accomplish the same
thing. Even the same manufacturer may change codes with new
models. For example, Epson's line spacing codes may mean
DIFFERENT THINGS (or may be irrelevant) depending on whether
you're dealing with early or later model Epson printers.
This is an impossible nightmare for most programmers. They simply
don't have the time or resources to obtain appropriate codes for
each printer. Fortunately:
* This printer database is available, giving programmers tools
to manage hundreds of printers in basic ways with just a few
lines of code, and without having to worry about which printer
is installed (or which printer their user switches to).
* And printer manufacturers seem to be standardizing on a small
core of "emulations." They've realized, it appears, that the
programmer's nightmare might mean their printer won't get sup-
ported. So, by building in options to emulate Epson, LaserJet,
ProPrinter or other popular printers, they can ensure broad
support for their printers.
About 8 basic emulation modes exist:
1. Early Epson 9-pin 2. Later Epson 9-pin
3. Epson LQ (24-pin) 4. IBM Graphics
5. IBM Proprinter 6. Hewlett-Packard Laserjet
7. Diablo 8. Qume Sprint
Most newer printers emulate at least one of these. Some emulate 2
or more. But printers still exist that use proprietary codes. This
printer database will help you manage the vast majority of them.
=================================================================
Section V: Using Printer.Exe to Select or Install Printers
=================================================================
As we mentioned, PRINTER.EXE is a multi-purpose program that:
* You may distribute along with your programs (if you wish).
* Compresses printer codes by about 85 percent (and ZIPs to a
much-smaller file of about 40k).
* Allows users to:
-- Select a printer from a menu.
-- Review and edit printer codes.
-- Save a small file (Printer.Cfg; 2k) to disk with
appropriate codes for their printer.
YOUR program(s) need only deal with this small "config-
uration file" to get all the information you'll need
to drive your user's printer (for the most part).
* Allows YOU to expand the database to its full, fixed-record size
and format. You may then use our PDT program to view and edit it.
Selecting a Printer
-------------------
To select (or install) a printer, you (or your users) would simply:
1. Run Printer.Exe. Instructions on what to do next always
appear at the bottom of your screen.
2. A menu will pop up with the names of hundreds of printers.
(On slow PCs it can take a while to load this menu.)
3. TO SELECT A PRINTER, highlight it and press <Enter>. To
exit to DOS, press F10. To highlight a printer:
- Press Down, Up, PgDn, PgUp, End or Home.
- Or press the first letter of the manufacturer's name.
For example, to view Epson printers, press "E." If
"Epson" is not the first manufacturer whose name begins
with "E," press "E" or Down or PgDn until you find Epson.
Highlight your printer (or one close to it), then press <Enter>.
You'll then have a chance to review and edit the printer codes.
NOTE: If your printer isn't listed in the menu, choose one
that's close. Then review the printer codes and edit them as
needed. And beware that your printer may appear 2 or more
times -- if it emulates 1 or more printers.
continued . . .
Selecting a Printer (continued)
4. ONCE YOU SELECT A PRINTER, we'll display all printer codes we
have for that printer. This gives you a chance to review or
edit them. Press F10 to select a different printer or to exit.
- To REVIEW printer codes, press Down or Up cursor keys.
- To EDIT a printer code, press Down/Up to highlight a code,
then press <Enter> to indicate you want to edit it. Edit
the code, then press <Enter> again to accept it.
5. IF YOU CHOOSE TO EDIT A CODE, an edit window pops up. It
identifies the code, and, if appropriate, alerts you if the
code you're editing contains ASCII character 0. If you see
this message, take care that you don't inadvertently delete
Chr$(0) or replace it with a space (Chr$(32)).
While editing printer codes:
- Press Escape to enter Escape -- ASCII character 27.
- Press Ctrl-2 to enter ASCII character 0.
- To enter ASCII characters 1-31 or 128-255, hold down ALT,
then enter the ASCII number on the numeric keypad.
- Press Ctrl-Home to erase a code, or Ctrl-End to erase
from the cursor to the end of the line.
- Press <Enter> to accept the code as edited.
6. WHILE REVIEWING PRINTER CODES : : :
- Press F2 to SAVE printer codes. Printer.Exe will save the
codes (as edited) to Printer.Cfg, and will then exit to DOS.
You MUST do this before pressing F10, or any changes you've
made will be erased. The database codes aren't changed.
If "Printer.Cfg" already exists, we'll overwrite it! To
prevent this, rename "Printer.Cfg" before running Printer.
See Appendix I as well as The_Prn.? for information on how to
read Printer.Cfg and use its codes from within your programs.
And remember that we also included Edit.Exe in case you (or
your users) need to edit the printer codes in Printer.Cfg.
- Press F10 to return to the "select a printer" menu. There
you can select another printer, or press F10 to exit to DOS.
continued . . .
Editing Printer Codes (continued)
NOTES:
------
* Because Escape is a valid printer code, we use F10 rather than
Escape to back up to the previous menu, or to exit to DOS.
* Some printer codes contain ASCII character 0. Because this
looks like a space (character 32), one must take care when
editing these codes. And character 0 cannot be entered as
other characters can.
- If, when you select a printer code to edit, it contains
character 0, we'll display a message urging you to be
careful when editing this code.
- IBM declared that Chr$(0) be entered as Ctrl-2! So we've
adopted that "standard," such that it is.
* Printer.Cfg is a 2k, fixed-length file with space for 70
printer codes and their labels. See the next section for
details on using codes in Printer.Cfg. And see Appendix
I for details on the record/field structure of both Printer.Cfg
and Printer.Dat (the expanded, fixed-length database).
* We have not built in an option to edit the labels associated with
each printer code. In most cases this is okay. But the final
set of codes will all be labelled "User" -- not very descriptive.
Using Edit.Exe: Editing Printer.Cfg
====================================
We included Edit to serve a need such as this:
* You distribute Printer.Exe and Edit.Exe with your programs.
* Your users use Printer to select a printer, and then no longer
want to consume it's 130k of disk space. So they delete it
(keeping a backup in case they must install another printer).
* But they may need to edit or add printer codes. So they keep
the 9-k Edit.Exe around to edit Printer.Cfg.
Edit works just like Printer.Exe does -- except you don't select a
printer first. Edit reads Printer.Cfg (or aborts if Printer.Cfg
isn't on the current path). It then displays the printer codes,
lets you edit them, than asks you to press F2 to save them. Like
Printer, Edit will overwrite Printer.Cfg when you save new codes.
F10 aborts the edit, leaving the existing Printer.Cfg intact.
Using Printer.Cfg in Your Programs
==================================
Be sure to see Appendix I and demo programs (Demo_Prn.?).
Printer.Cfg, the printer configuration file saved by Printer.Exe
when you select a printer, consists of two, 1024-byte records.
* Both records begin with a 44-byte header identifying the
printer. Appendix I describes the header's layout.
* The remaining 980 bytes consists of 70, 14-byte fields,
1 14-byte field for each printer code.
- Record #1 contains descriptions (labels) for each code.
- Record #2 contains the actual printer codes.
We chose this record format to make it easy, from within your pro-
grams, to display all 70 printer codes and their descriptions.
Saving the labels will be especially useful when (if) we offer
an option letting users change the labels as well as the codes.
* With so many printer options to choose from, we've found it
helpful in our own programs to display which printer options
are available, and what users should do to invoke each. See
Demo_Prn.?. for code that might give you a start here.
* If you do display the labels and codes, you might want to offer
users a printed description of each code. 14-byte fields con-
strain what we can say. So users might benefit from something
that translates our terse abbreviations into something meaningful.
Both The_Prn.? and Printer.Dat include fuller descriptions of
each code.
Using the Printer Codes from Within Your Programs
-------------------------------------------------
You can use the TYPEs (structures) you'll find in The_Prn.? to load
printer codes from Printer.Cfg. Or, use any 1024-byte variable to
read them. Or, read the 44-byte header, throw it away, then read a
980-byte record. Or set up a 70-element array, then just read (or
parse) each code into an element.
Finally, just trim trailing spaces (Chr$(32)) from a code and
send it to the printer.
* Remember to first scan codes for our "placeholder" -- √. If
it exists, you MUST replace it. NEVER send it to a printer.
In a later section, we'll explain how to customize these.
* Also, remember to leave Chr$(0)s intact -- in BASIC use
RTRIM$, NOT Crescent's qpRTRIM or pdqRTRIM.
Examples (using BASIC code)
--------
These examples assume we used the Types/Structures in The_Prn.Inc
to read printer codes. These examples use BASIC's "lprint" or "line
print" function.
* To INITIALIZE (reset) the printer to power-on mode:
lprint rtrim$(ThePrn.Initialize);
* To UNDERLINE text:
lprint rtrim$(ThePrn.UnderlineON); Text$;
lprint rtrim$(ThePrn.UnderlineOFF)
* To print text in BOLD:
lprint rtrim$(ThePrn.BoldOn); Text$; rtrim$(ThePrn.BoldOff)
* To turn on 8 lines-per-inch (8 LPI):
lprint rtrim$(ThePrn.LinesPerInch8);
That's it! For the most part, it's that simple. And you needn't
care which printer is installed, or whether users install a dif-
ferent printer.
=================================================================
Section III: Using Printer.Exe
Expanding The Printer Database; Creating PRINTER.DAT
=================================================================
Printer.Exe can create a fixed-length, random-record database.
* A new file, PRINTER.DAT, will be created, requiring almost
800,000 bytes of disk space. If Printer.Dat already exists,
we'll tell you so and quit. One way this might happen is if
the PDT structure file by the same name exists on the current
drive/directory (it should be in PDT.DIR, not where you are).
NOTE: Shareware versions write out only about 45 records.
So disk space requirements are much less.
* Once expanded, you can easily view and edit Printer.Dat, add
records (printers), change or add printer codes, etc. PDT is
an excellent tool for this.
* You can also read Printer.Dat from your programs. But doing
so may needlessly consume lots of disk space. Using the ".Cfg"
file from your programs is much more space-efficient.
* Please note that once expanded, there's currently no way to
re-compress the database and re-create Printer.Exe.
- If you add printers, or add codes for certain printers, or
change codes, feel free to send us the changes (in 1024-byte
records, in the original field-format). PDT's Block Mark and
Block Export options make this an easy task.
- We'll be happy to consider re-creating Printer.Exe for you.
To Expand the Database
----------------------
Verify there's about 1 million bytes of free disk space. Then type:
printer rws-54321 (that's a hyphen).
We WON'T verify that sufficient disk space is available -- YOU must.
As the database expands, we'll show which record number we're on.
Record numbers should fly by. If they slow to a crawl or stop,
we probably ran out of disk space. Press Escape, then check the
disk space. If it's 0, clear some space, then repeat the process.
=================================================================
Section IV: Using Codes with "Placeholders"
=================================================================
While we've tried to design The Printer to be almost painless,
using some printer codes requires some work. Fortunately, these
codes can also yield significant powers and benefits.
We mentioned earlier that some printer codes contain "√" (ASCII
character 251) -- a placeholder for value(s) you must supply.
"√" should NEVER be sent to the printer. Instead, you must
replace "√" with a string value appropriate for your situation.
Here are general guidelines for replacing placeholders and using
these codes. To see some of these in action (and masterfully),
capture-to-disk a document printed by WordPerfect or Microsoft
Word. Then examine the file in PDT.
To use some of these, you need formulas or need to know which
units-of-measurement each printer uses. We've included guidelines
for Epson printers and HP LasetJets. Later we may offer guidelines
for other printers.
Please note that, with some codes, it's not sufficient to know the
printer is an Epson (or emulates one). Epson CHANGED the meaning
of certain codes (eg., Line Spacing) when they introduced the LQ
(24-pin, Letter Quality) printers. So the same printer code can
yield different results if you're dealing with an Older 9-pin, a
Newer 9-pin or a 24-pin LQ Epson.
GENERAL GUIDELINES
==================
* "<" means character 27 (Escape) as in "<A√."
* Printer codes are strings. When you replace our placeholder,
especially if you send a number, you should do so by sending
either:
- Its string equivalent (eg., Str$(SomeNumber) in BASIC).
LaserJets usually require this string version (eg., <(s9T).
- Or a character (eg., Chr$(SomeNumber) in BASIC). Epson
printers usually accept this version (eg., <A + Chr$(19))
* In most (but not all) cases if you send an unrecognized printer
code, the printer simply ignores it. So, for example, if you
tell an old Epson FX printer to switch to the Orator-S font, it
won't know what you mean and simply ignores your request.
The main (only?) exceptions to this are the Line Spacing com-
mands on Epson printers. For example, "<3" + Chr$(30) means 6
lines-per-inch on LQ printers, but 7.2 LPI on FX printers.
Option Epson LaserJet
======================= ================== ===================
Select Character Sets
(USA, France, etc.) <R√ <(√√ (Symbol Set)
--------------------------------------------------------------------
Use with: Where √ = Chr$(#) NOTE: This selects
a Symbol Set, and is
- Most Epson LQ printers. 0 (USA) thus not truly equiv-
1 (France) alent to Epson logic.
- Most newer 9-pin 2 (Germany) See options below for
printer (through #9). 3 (England) why we placed this here.
4 (Denmark) These REQUIRE appro-
- Most older 9-pins 5 (Sweden) priate fonts.
(through #6). Not MX. 6 (Italy)
7 (Spain) Where √√ =
8 (Japan)
9 (Norway) 8U = Roman-8
10 (Denmark 2) 10U = PC-8 (w/ line draw)
11 (Spain 2) 11U = PC-8 DN
13 (Korea) 8K = Kana-8
64 (Legal) 8M = Math-8
0U = USASCII
0B = Line Draw
0E = Roman Extension
0D/1E/0F/0G/0I/0S/1S =
Denmark-Norway, UK,
France, Germany,
Italy, Sweden-
Finland and Spain,
respectivly.
1U = Legal
0N = ECMA-94
Select Master Font <k√ <(s√T (Type Face)
--------------------------------------------------------------------
Use with: Where √ = Chr$(#) Where √ =
- LQ printers (except 0 (Roman) 0 (Line printer)
LQ-1500 and LQ-2000). 1 (Sans Serif) 1 (Pica)
Options 2-8 may require 2 (Courier) 2 (Elite)
an optional font module. 3 (Prestige) 3 (Courier)
4 (Script) 4 (Helvetic)
- Newer FXs, use only 0, 5 (OCR B) 5 (Times Roman)
1 & 2, and only with: 6 (OCR-A) 6 (Gothic)
DFX-500, FX-86/286, 7 (Orator) 7 (Script)
FX-850/1050, FX-800/1000, 8 (Orator-S) 8 (Prestige)
LX-800/810, T750, Apex-80. 9 (Caslon)
10 (Orator)
- NOT applicable with older Epsons.
Option Epson LaserJet
======================= ================== ===================
Master Select <!√ Not applicable (n/a)
--------------------------------------------------------------------
Use with: Where √ = Chr$(#)
- LQ printers. 0 (Pica)
1 (Elite)
* NLQ mode required. 2 (Proportional) *
4 (Condensed)
** Not SQ-2000 8 (Emphasized)
16 (Double Strike)**
32 (Double-Wide)
- With newer FXs, many 64 (Italic)
are available in Draft 128 (Underline)
mode only (not NLQ),
and Proportional, Italic
and Underline may not be
available this way. Use
other codes for this.
- Many are NOT applicable with older 9-pin Epsons.
Variable Line Spacing <A√ <&l√D
--------------------------------------------------------------------
Where √ = Chr$(#) Where √ =
LQ: #/60 inch 1, 2, 3, 4, 6, 8,
FX: #/72 inch 12, 16, 24 or 48
lines-per-inch.
Replace √ with a
character. For
example, for 3/60"
use "<A" + Chr$(3).
NOTE: This is 1/3 the
resolution of <3√ below.
Alternate Variable Line <3√ <&l√C
Spacing
--------------------------------------------------------------------
Where √ = Chr$(#) Where √ =
LQ: #/180 inch The number of 1/48
FX: #/216 inch inch increments per
line. For example:
For example, for
4 lines/inch: "<&l6C" = 6/48 = 1/8
or 8 lines/inch.
LQ: "<3" + Chr$(45)
FX: "<3" + Chr$(54)
NOTE: This is 3-times
the resolution of <A√.
Option Epson LaserJet
======================= ================== ===================
Page Length: Inches <C + Chr$(0) + √ n/a
--------------------------------------------------------------------
Where √ = Chr$(#)
A character from
Chr$(1) to Chr$(22)
indicating 1 - 22 inches.
Page Length: Lines <C√ <&l√P
--------------------------------------------------------------------
Where √ = Chr$(#) Where √ =
A character from The number of lines
Chr$(1) to Chr$(127) on the page (using
indicating 1 - 127 the currently-selected
lines. line spacing).
NOTE: When Laser-
Jets receive this
code, they RESET
Top Margin, Text
Length, and Left/
Right Margins. So
set Page Length 1st.
Set Tab Stops <D√√√√√√√√+Chr$(0) n/a
--------------------------------------------------------------------
Where EACH √ = Use <&a√C to jump
to any column --
Chr$(1) to Chr$(?) based on the pitch
of the "current" font.
- "?" = 137 for 80-
column printers. NOTE: See "Absolute
Move to a Horizontal
- "?" = 233 for Position" for a pitch-
wide-carriage independent way to
printers. move right/left.
NOTE: The values
you use depend on
the pitch of the
current font.
- Pica = 10 CPI
- Elite = 12 CPI
- Condensed = 15 CPI
The ending Chr$(0)
is REQUIRED!
When a TAB (Chr$(9)) is
issued, printing starts
at the NEXT column -- not
the one you specified!
Option Epson LaserJet
======================= ================== ===================
Set Top Margin n/a <&l√E
--------------------------------------------------------------------
Where √ =
1, 2, etc. for the
line number (using
the current line
spacing).
NOTE: The top and
bottom 1/2 inch (about
2 lines) is an "un-
printable" area. Print-
ting here results in
lost data. HP recom-
mends a minimum of 2.
Set Bottom Margin n/a n/a
--------------------------------------------------------------------
NOTE: The bottom
Note: This is a curiosity. margin equals:
It's NOT relevant on page- Page Length
oriented laser printers. minus Top Margin
minus Text Length
It IS used on some non-Epson
dot-matrix printers. But Skip Perforation
often, you have to go down is useful to print
there, then say "this is the beyond line 60! I
bottom." recommend you ALWAYS
use Skip Perf., then
We included it here for control how far down
completeness, even though you go. Since Lasers
it's irrelevant for these enjoy spitting the
groups of printers. page out when you hit
line #60 (while many
printers happily accept
64 lines), Skip Perf.
helps you tame this
prediliction.
Set Left Margin <l√ <&a√L
--------------------------------------------------------------------
Where √ = Chr$(#), Where √ = a column
a column number.
NOTE: That's a - The 1st column is
lower case L, not column #0.
the number "1."
Option Epson LaserJet
======================= ================== ===================
Set Right Margin <Q√ <&a√M
--------------------------------------------------------------------
Where √ = Chr$(#), Where √ = a column
a column number. number.
Minimum and maximum - The 1st column is
values differ depend- column #0.
on both the pitch and
the carriage width. - Column positions
vary with the pitch
of the current font.
ABSOLUTE Move to a n/a <&a√V
VERTICAL Location
--------------------------------------------------------------------
Where √ = the new
Example: Move to row 5. vertical location in
1/720 inch increments.
Example: "<&a600V"
jumps to line # 5
(600/720 = .83 or line
5 at 6 lines-per-inch).
LaserJet Notes: <&√R moves to a specific row -- but dependent on
the current line spacing. <&a√V is invulnerable
to user changes in line spacing.
RELATIVE Move to a n/a <&a√√V
VERTICAL Location
--------------------------------------------------------------------
Use the same code(s) as
Example: Move UP 3 lines. above but with "+" or
"-" before √, to move
down or up, respectively.
ABSOLUTE Move to a <$√√ <&a√H
HORIZONTAL Location
--------------------------------------------------------------------
This begins Where √ = the new
Epson: Newer LQ only. printing from horizontal location in
the left margin 1/720 inch increments.
Example: Move to in 1/60 inch
column 14. increments. Example: "<&a1080H"
jumps to column # 14
# of dots = (1080/720 = 1.4 inches
n1 + (n2 * 256). or column 14 at 10
characters-per-inch).
LaserJet Notes: <&√C moves to a specific column -- but is dependent on
the pitch of the current font. <&a√H is invulnerable
to font pitch.
Option Epson LaserJet
======================= ================== ===================
RELATIVE Move to a <\√√ <&a√√H
HORIZONTAL Location
--------------------------------------------------------------------
Epson: New LQ only. To determine the Use the same code(s)
2 numbers, first as above but with "+"
calculate the dis or "-" before √, to
Example: Move 5 columns placement in dots. move right or left,
right. - If moving left, respectively.
subtract this
number from 65536.
Send the resulting
number using the
formula:
# of dots =
n1 + (n2 * 256)
A dot is 1/120 inch in
Draft, and 1/180 inch
in Letter Quality or
Proportional modes.
Set Inter-Character <+ Chr$(32) + √ <&k√H
Spacing
--------------------------------------------------------------------
Note: Change distance Where √ = Chr$(#) Where √ = the
between characters. indicating the number of 1/120
number of dots to inch increments
Epson: New LQ only. move right after between characters.
each character.
Example: <&k12H
A dot is 1/120 inch sets 10 characters
in Draft, and 1/180 per inch (12/120 = 10).
inch in Letter
Quality or Propor- With proportional fonts,
tional modes. only SPACE is affected.
=================================================================
Appendix I: The Record Structure of Printer Data Files
=================================================================
Record Length
-------------
Both Printer.Dat and Printer.Cfg consists of 1024-byte records.
The_Prn.? and Printer.Dat both describe the record/field layout.
If you open PRINTER.DAT in PDT (Ctrl-O), PDT should automatically
format your view of it into logical rows and columns.
* This ONLY happens if the PDT structure file we included (also
called Printer.Dat) is in PDT's special directory: PDT.DIR.
* If PDT does NOT automatically format your view, it couldn't find
Printer.Dat in PDT.DIR. We urge you to put it there, then run
PDT again. Or, you could run PDT, open the file, and press
Ctrl-L and enter 1024 to tell PDT the record length. This sets
the record length, but WON'T give you field names, values, etc.
Note: If you open Printer.Cfg in PDT, PDT will NOT automatically
format your view of it -- unless it finds a "structure" file in
PDT.DIR called "Printer.Cfg." You could:
* Just copy the structure file we sent: copy printer.dat *.cfg.
We urge you to do this so that every time you open a ".Cfg" file,
PDT will lay it out for you automatically.
* Or, once you load the ".Cfg" file into PDT, then press F5 and
load the structure file called "Printer.Dat."
Record # Description
-------- -----------------------------------------------------
1-5 Reserved. These contain our copyright, notes on the
format of each record, labels for each field, and room
for expansion.
Note: We always find need to add things to databases
once created. So reserving room to expand into
minimizes the chances we'll have to render someone's
existing database obsolete! Please leave these intact,
or at least plan for them to be included in future
versions -- that is, begin reading at record 6.
6-### One record for each printer, listed alphabetically.
Some printers may have 2 or more records if they offer
2 or more emulations.
Field Structure
---------------
"The_Prn.?" contains two TYPEs (or structures) you can use to under-
stand the codes and read them from within QB programs. The PDT
structure file, Printer.Dat, contains similar data.
Most fields in both Printer.Dat or Printer.Cfg are 14 bytes.
The exceptions are fields 1 and 2. Field #1 is a 1-byte field
reserved for our use in development. Field #2 is 15 bytes and
contains the name of the manufacturer of the printer (e.g., Epson,
Star, Xerox, etc.).
The first 44 bytes of each printer record is a header identifying
the printer. Thus the first TYPE in The_Prn.? is PrnHeader. We use
separate TYPEs for the header and the codes to give you flexibility
and to minimize memory usage (use the header only when needed).
# of
Bytes Contents
------- ------------------------------------------------
1 Reserved (used in development)
15 Manufacturer (eg., Epson)
14 Model (eg., FX-286)
14 Emulation mode (eg., printer emulates an Epson LQ)
The remaining 980 bytes consist of 70 14-byte printer codes. So
the 2nd TYPE in The_Prn.? is ThePrn. Review it and you'll see:
# of
Bytes Contents
------- ------------------------------------------------
14 Initialize (reset) printer
. Set 10 Characters-per-inch (10 CPI)
. Set 12 CPI
. Set Condensed print On
. Turn Condensed print Off
. .
. .
. etc.
Review The_Prn.? or Printer.Dat for the order and descriptions of
each code. Labels are also included in the database. And PDT will
display column headings IF: it finds its structure file (also
called Printer.Dat), and you press Ctrl-D (Display Field Labels).
=================================================================
Appendix II: Using PDT to View and Edit ANY File
=================================================================
PDT comes with both extensive on-line help, plus an on-disk manual.
But here are the basics you'll need to take full advantage of PDT
when viewing Printer.Cfg or Printer.Dat (and some other files).
Installation
============
1. Install PDT in a directory on your path, or in it's own
directory (then add PDT's path to your PATH statement).
2. BE SURE that PDT's special subdirectory (PDT.DIR) is created
off the directory containing PDT.EXE. PDT's "install" program
will do this for you. But if you didn't use Install, be sure
to: md pdt.dir.
3. Also BE SURE to copy the structure file "Printer.Dat" to
PDT.DIR. Install.Exe won't do this for you since it's not
part of PDT.
- Make a copy of this file, but with a ".Cfg" extension:
copy printer.dat *.cfg.
Opening a File
==============
1. MOVE to the path where you've installed The Printer.
- Run Printer.Exe and select a printer (try an Epson).
BE SURE to press F2 so we save Printer.Cfg.
- Also, if you like, run Printer.Exe and expand the
database to it's fixed-length format.
2. Run PDT like this: pdt printer.cfg <enter>
or, pdt printer.dat <enter>
- IF you followed step 3 above, either command should yield
a display of logical rows and columns.
- Fields will be displayed in alternating colors. As you TAB
from field to field, notice near the bottom of your screen:
-- FIELD: will change to show you which field you're in.
-- VALUE: will show the "value" of the field you're in.
This is especially useful with packed binary numerics.
- Press Ctrl-D. PDT will display column labels atop the file
window showing what's ahead of and what's behind your cursor.
Managing Other Files
====================
1. Close the file (Ctrl-C), then open one of your own (Ctrl-O).
If you have a dBase file, try it first. If your dBase
file does NOT have a ".DBF" extension, press Alt-O and
select "Force dBase" from the Options menu.
2. Now for some fun! Make a COPY of a fixed-length, random file
with BINARY NUMERIC fields in it. Now open the copy (Ctrl-O).
- Press Ctrl-L and enter the Record Length.
- Press Home, then press F2. Press a letter indicating the
Field Type: <c>haracter, <i>nteger, <l>ong, etc.
Press <Enter> and enter a label or description.
Press <Enter> again, then move the cursor to the next field.
Press F2 again, then repeat this process.
Continue this until you have AT LEAST 1 numeric field defined.
PRESS F4 and SAVE this structure -- with the SAME NAME as your
data file. PDT saves it to PDT.DIR so it won't overwrite data.
3. Now move your cursor to a numeric field you defined (TAB or
Shift-Tab can now get you there quickly).
-- Note "Value" at the bottom of the screen. Now move up or
down the column and watch "Value" change.
-- Stop at some number and WRITE DOWN its value. Now press
Ctrl-E (Edit ON), then press F6. Enter a new number and
press <Enter>.
If you followed these steps, you should have just edited
a packed binary field in easy-to-understand ASCII. When
you pressed <Enter> PDT saved the binary version to disk.
-- Now press F6 again and enter the original number you wrote down.
4. Close the file (Ctrl-C). Now immediately re-open it. IF, in
step 3 above, you pressed F4 to save the structure, PDT will
open your file with everything mapped out for you!
IF YOU FOLLOWED THESE SIMPLE STEPS, you've just seen two of PDT's
most useful functions.
* PDT can (with your help) turn almost any fixed-length file into
logical, easily-edited rows and columns. You can TAB from field
to field to view or edit fields. And you can easily determine or
edit field values -- even packed binary fields.
* PDT can "automate" this, provided you save structure files.
Advanced Options
================
And if you're concerned that if you ADD printer codes to YOUR
database, AND we send you an update, that you won't be able to
merge your stuff with ours:
* BE SURE to try Column Block Mark (Ctrl-M) then Block Copy (Ctrl-W).
You can EASILY open your customized file in one window, then open
an update we send you in another window, then simply paste an
entire column (or 2, 3, or ? columns) of codes from one file and
into the column(s) of another file!
Also try:
* Block Mark and Block Export.
* Delete a record: With Edit on, press Ctrl-B to mark a record,
then press <Delete>.
* Or try record insert: With Edit on, press Home then Insert.
* Finally, open Sample_2.Dat and check out the EBCDIC options.
Just to emphasize what's probably obvious by now, PDT does NO
buffering. What you change is immediately written to disk.
* That's the main reason it can help you edit ANY SIZE file --
up to 2 gigs.
* That's also why we urge you to experiment on a COPIES of files.
* And that's why Edit mode is OFF be default. You must turn Edit
ON before you can change anything.
To Register or Order
==================================================================
Because we offer so many programs, our order form has 2 pages.
Please read CATALOG.DOC for descriptions of each program.
* THIS PAGE lists our programs and the per-copy cost of each.
* THE NEXT PAGE is the actual order form.
- On the next page, fill in the name of each program you're
ordering. PLEASE BE CAREFUL here and use the names listed
below. If we're not sure which program you're ordering,
we may have to return you're order.
- If ordering by Visa or MasterCard, fill in the section
for credit card orders. BE SURE TO SIGN it.
Program Name Per Copy
==============================================================
Multi-Print $29 if ordered w/ ANY other program $39/$29
The Printer Programmer's Printer Code Database $49
Font Pak "Pro" Programmer's Fonts & Mouse Shapes $49
Font Pak "DOS" Hundreds of DOS text-mode fonts $29
PDT The Pro~Formance Data Tool $139
inform-Z Professional Forms Design/Database $49
Mail Call With MC Express $49
" " Without MC Express $40
Pro~Scribe & PS Express $39
P~F Presents Professional $79
" " Plus (with intro. copyright) $49
P-Screen Professional $49
" Plus $29
Pro~Stamp Stamp Collection Manager $29
Ram-Man RAM-resident Text File Browser $19
Sparkle AND Menu Magic $29
The Survey Catalyst $495
=================================================================
PACKAGE DISCOUNTS Call about quantity discounts & site licenses.
=================================================================
THE WORKS! One of each program (except The Catalyst) $349
inform-Z AND Mail Call $79
P-Screen Pro AND P~F Presents (Pro versions of both) $109
============================= TO ORDER =============================
For FASTEST delivery of your programs, CALL with a Visa/MC card number.
F __________________________________________ M Rob W. Smetana
Pro~Formance
R __________________________________________ A T 132 Alpine Terrace
San Francisco, CA
O __________________________________________ I O 94117
(415) 863-0530
M __________________________________________ L
Make checks payable
Phone ( ) ______-________ Date ___/___/___ to: Rob W. Smetana
=======================================================================
For Visa or MasterCard Orders
=======================================================================
Credit Card Number: ________________________________ Expires: ___|___
Signature (Required for credit card orders): __________________________
Be sure your name at the top matches how it appears on your credit card.
============================================================ prn 1.4 ==
Name of Program or "Package" # of Copies Price/Copy Total
=======================================================================
Multi-Print ($29 if ordered /w other pgm) _____ x $29/$39 = $_______
_____________________________________ ________ x ______ = $_______
_____________________________________ ________ x ______ = $_______
=======================================================================
Shipping & Handling: Total Number @ $4/copy (US/Canada)
of Programs (and Copies) ----->> _____@ $8/copy (Elsewhere) $ ______
=============================+=========================================
| Subtotal $ ________
INTERNATIONAL ORDERS: : : |
| CA. residents, add 8.5% tax $ _______
* US funds only please. +-----------------------+-----------------
* Money order, check drawn a |
US bank, or VISA/MasterCard |TOTAL $ ________
=====================================================+=================
WHERE did you got your copy of our program? _________________________
This helps us learn the best way to get new programs to you. And feel
free to write comments and suggestions on the other side. Thank you.