home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
print
/
lp3820
/
lp3820.doc
< prev
next >
Wrap
Text File
|
1993-05-27
|
58KB
|
1,394 lines
lp3820 - Print AFP documents on a personal laser printer
(C) Copyright IBM Corp, 1990, 1993
Ken Borgendale - IBM Boca Raton
Version 2.3a - 27 May 1992
License
=======
This tool is offered "asis" without any claim of suitability and
without any warranties. Use and distribution is governed by the
license which is included in the file LICENSE.TXT.
Release Notes
=============
Version 2.3 has significant improvement in PCL5 (HP LaserJet III,
HP LaserJet 4, and IBM LaserPrinter 4039) support. There is also
new support for hardware duplex and some bug fixes. There are no
changes to the raster font package (LP382F).
Introduction
============
Most of the IBM print documents available on the IBM mainframe systems
are in the AFP (Advanced Function Print) format, designed to be
printed on the 3820, 3800-3, 3812, and all of their successor
products. These files have file types such as LIST3820, LIST38PP,
PSEG3820 and OVLY3820. Most of these documents are created by DCF
(Script, BookMaster), but they are also created by other products such
as GDDM and DisplayWrite/370. The printers which print these
documents are large shared printers attached to the host. The
direction today is toward small, personal laser printers attached to
PCs. These printers are supported by word processing packages on the
PC, but are unable to print host documents. The lp3820 package
attempts to bridge this gap by allowing most AFP documents to be
printed on a personal laser printer. lp3820 can be used to print
draft copies, or to print distributed documents.
Some documents will not print correctly, and the font appearance and
spacing differ from the AFP fonts. lp3820 is a datastream converter.
It takes in an AFP file, and puts out a personal printer datastream.
It is not designed to help you move your data between the host and the
PC (either the input or output datastreams). This document contains a
description of how to install and use the lp3820 package.
The following formats of AFP documents are supported:
■ LIST3820 - Document for the 3820 and most other AFP printers
■ LIST38PP - Document for the 3800 mod 3 and 6
■ LIST4028 - Document for the 4028 (300 dpi)
■ LIST4250 - Document for the 4250 (600 dpi)
■ LISTAPA - 3812 or 3816 document
■ OVLY3820 - Overlay for the 3820
■ PSEG3820 - Page segment for the 3820
■ PSEG38PP - Page segment for the 3800-3
Page segments and Overlays are treated as one page documents.
lp3820 deals with personal laser printers in three modes:
1. PPDS - Personal Printer Datastream (native mode on the IBM
LaserPrinter 4019 and 4029). There are variations of this for the
4019 and 4029.
2. HPPCL - HP Printer Command Language (native mode of the HP
LaserJet series, and emulated on most other personal laser printers).
- PCL4 for the HP LaserJet II and compatibles
- PCL5 for the HP LaserJet III, IBM 4039, and compatibles
- PCL5 extended for the HP LaserJet 4
Printers before the LaserJet II are not supported, but they may
work with some restrictions.
3. PostScript - Adobe printer language (used in a large number of high
end personal printers, and available for the IBM LaserPrinter).
In addition to these printers, lp3820 will also allow the text of an
AFP file into a flat file. This can be used to extract the text from
a print file, or to view the contents on the display.
Note: Mixed orientation pages (such as rotated tables) are not
supported on 4019 and HP PCL4 printers. Multi-up capabilities are only
supported in PostScript.
In order to print text within the AFP documents, lp3820 provides a
large set of soft fonts. lp3820 can use the resident fonts (but they
must be declared). lp3820 uses soft fonts in either PPDS or HPPCL
mode, and converts as necessary for the printer. The soft fonts
shipped with lp3820 are in PPDS mode, but are converted to HPPCL or
Postscript mode as necessary when printing. Any PPDS or HP-PCL4 soft
fonts can be used.
lp3820 downloads PostScript fonts in either ASCII (.pfa) or binary
(.pfb) to either a PostScript or 4029 printer. lp3820 provides
PostScript type 3 soft fonts for the IBM logo and extended typographic
fonts.
Getting Started
===============
If you are an expert user who does not read documentation, all you
have to do in unzip lp3820 (and optional font package), extract the
fonts, and make sure everything is in the path. Since you are reading
this document, you probably want that in just a bit more detail, so
read on.
You will need the following to run lp3820.
1. An IBM PS/2 (or reasonable facsimile) running OS/2 (any version)
or DOS (3.3 and above) on at least a i286 processor and 400Kb
free memory.
2. A laser printer. Just about any kind will do, but it must be an IBM
LaserPrinter, emulate HPPCL, or run PostScript. If your printer does
several of these, you can use it any way you like. You can use the
TEXT conversion without the laser printer.
3. Disk space (you will need extra during install)
4029 PPDS or PostScript 500K
4019 PPDS or HPPCL 1800K
4. LP3820.ZIP
5. If you are running an IBM LaserPrinter 4019 in PPDS mode, or a
printer in HP mode before the LaserJet 4, you will also need the
softfont package LP382F.ZIP. You can use your own soft fonts
instead. Any PPDS or HP-PCL fonts will work, but you must create
font declarations for them in place of the "include !stdfont" line
in the profile.
7. Some AFP files to print. The package is very dull if you do not
have anything to print.
Installing lp3820
=================
The installation of lp3820 consists of 6 steps:
1. Making a directory to put it in
2. Unpacking lp3820
4. Updating the profile
5. Setting the LP3820 environment variable
6. Making sure it all works
Note: The example commands shown here may have to be changed based on
what tools you have installed, and what directories you put things in.
Making a directory
------------------
Select a drive which has enough space (2.7 meg for install, 1.8 meg to
run) and create a directory. If you are not going to install the fonts,
you might want to install lp3820 in an existing directory in your path
instead. For example, the command:
md c:\lp
cd c:\lp
will make a directory called lp on your c drive. This name will be
used in the following examples, but you may put it on any drive and in
any directory. This directory should either be in your PATH, our you
must change directory to it before using lp3820.
Unpacking lp3820
----------------
lp3820 comes as a zip file which includes this document. You should
run pkzip to unpack all of the files. These files do not have to be
all in the same directory. You should get the following files:
lp3820.exe - OS/2 family mode executable file
lp3820.abs - A short abstract
lp3820.pro - user profile
lp3820.ftb - font metrics tables
lptest.afp - small test page
lp3820.doc - this file
license.txt - the IBM "asis" license
There is a second zip file containing the soft fonts. This is the
LP382F package. The soft fonts are quite large, and must be unpacked
before they can be used. Use pkzip to install them. The fonts are
not necessary if your printer is a 4029, LaserJet 4, or PostScript.
You will get a large number of files with the extension .dlf .
Note: If you get lp3820 preinstalled, you may distribute it by
placing all .dlf files and license.txt into lp382f.zip. All other
files (along along with license.txt) should be put unmodified into
lp3820.zip. You must include the IBM license and abide by it in any
copies or distribution you make of this program.
Updating the lp3820 profile
---------------------------
Before you can print using lp3820, you must tell it what kind of
printer you have. As shipped, lp3820 has no default, and so you must
either update the profile or specify a printer name each time you
invoke lp3820. Using your favorite editor, edit the file lp3820.pro.
This is the profile for lp3820, and it allows you to customize lp3820.
e lp3820.pro
You should see the entry:
default = none
This specifies which of the printer entries below is the correct one.
You can override this on the command line, but this line specifies
which printer entry to use by default. You should set this default to
match your printer. This is the name of a printer entry later in the
file. Set it to one of the following:
4019 = IBM LaserPrinter 4019 in PPDS mode.
4029 = IBM LaserPrinter 4029 in PPDS mode.
hp = HP LaserJet II or compatible (including 4019 in HP mode)
hp3 = HP LaserJet III (PCL5 including IBM 4039)
hp4 = HP LaserJet 4 (extended PCL5)
ps = Any printer in PostScript mode
You should also change the default paper size to match the paper you
have in your printer. If you are outside North America, you are
probably using A4 paper and not letter size. You can set the default
paper size to:
a4 = 211mm x 297mm
letter = 8.5i x 11i (default if not specified)
legal = 8.5i x 14i
exec = 7.25i x 10.5i
b5 = 182mm x 257mm
a5 = 148.5mm x 211mm
Each printer description consists of a few lines describing the
printer. The first line is a "printer" entry, and gives the name of
the printer. The next is a line for the printer type, and below that
a line for the printer port. If your printer is not attached to lpt1,
you will need to update the printer entry. You can create more
printer descriptions if you like, but you should model them on one of
the existing entries.
For the port, you can give the name of a device file, disk file, or a
file extension starting with a dot.
Note: There are a number of other things you can customize in the
profile. In a number of cases, alternatives are shown, but are
commented out. You can change entries in the profile to change the
appearance of the multi-up, add font definitions, or specify to use
the raster foils fonts in PostScript.
Setting the LP3820 environment variable
---------------------------------------
lp3820 needs to know where its files are. You can do this in several
ways:
1. Run with all files lp3820 needs in the PATH.
2. Run with all files lp3820 needs in the current directory.
(This is actually just a subset of the first).
3. Set an environment variable LP3820 giving a path to locate the
files. The .exe files must still be in the path. This option
gives maximum flexibility. You can set the lp3820 variable to
several directories, including any place you keep soft fonts.
set lp3820=c:\lp;c:\pclfonts
This statement should be placed in your config.sys for OS/2
mode, and in autoexec.bat for DOS mode.
Testing the installation
------------------------
With any luck, lp3820 will now work. To test it out, a one page
document is included in the package. To print it, type:
lp3820 lptest
This should show you an title line, and several normal fonts,
including some symbols (left arrow, theta, right arrow) on the last
line. This will also show the version of lp3820.
lp3820 is a 16 bit family mode application, and will run in either an
OS/2 or a DOS session. It will also run in DOS, but requires 3.3 and
above and a i286 or above processor. Complex documents may require
a large amount of memory in DOS mode.
Since lp3820 creates the final datastream for the printer, you must
either set the OS/2 print driver to match the datastream, or use the
IBMNULL print driver.
Now extract the text from the file by typing: lp3820 lptest.afp text
You should have the file lptest.doc on your disk. You should also try
lp3820 out on one of your own documents. To do this, download any
LIST3820 document. Remember to download the file in binary (without
doing EBCDIC to ASCII translation).
Notes and Restrictions
======================
lp3820 can often do a very good job at printing AFP documents on a
personal laser printers. However, there are some documents which do
not print correctly, and there are some cases when the appearance is
wrong. To understand why this occurs, you should understand the
differences between the host printers and their fonts, and the
personal laser printers and fonts.
Resolution: AFP documents are designed for the printers which print at
240 dots per inch. Personal page printers are mostly 300 dpi. Thus,
the same fonts cannot be used, and images must be scaled at a 4 to 5
ratio. There are options to control the scaling of the image.
lp3820 does support printing of documents formatted at 300dpi.
Page size: Most personal laser printers require a larger margin at
the edges of the page, and thus have a smaller printable area
than the 3820.
Font Differences: lp3820 maps host fonts to PC fonts. The fonts may
have different size and appearance than the host fonts for which the
document was formatted. This is especially true when the AFP
file was formatted using the Sonoran family of fonts (the basic
3820 fonts). The results are better when the new Core Interchange
font families are used.
Font Set: When you use DCF to create an AFP document, you format it
using a set of AFP fonts which are installed on your S/370. Many
sites have 100 Mb of AFP fonts installed (they are of course shared
between all users). lp3820 has internal support for many of the
fonts shipped by IBM.
lp3820 ships a set of soft fonts, but the number of fonts were
restricted to keep the size for the lp3820 package below 2Mb.
lp3820 ships fonts for 8, 9, 10, 11, 12, 14, 16, 18, 20, and 24
points. If you wish to take up more room on your disk, you can
install additional soft fonts. If you add soft fonts, you must
update the lp3820 profile to tell lp3820 what fonts are available.
Any available HP or PPDS soft fonts can be used. However, it is
very important that you correctly identify to lp3820 the codepage
that the font is in.
Code Pages: AFP supports an arbitrary number of code pages, by reading
the code page information from a file. The soft fonts used by
lp3820 do not have enough information to use this strategy. lp3820
has internal tables for a large set of code pages.
Rotation: lp3820 does not support rotation on 4019 or HP LaserJet II
printers.
Compressed Image: lp3820 does not support AFP documents containing
compressed (MMR, G3, G4) images. Only IM level images are
supported.
The lp3820 command
==================
lp3820 basically runs as a command line filter. You can integrate it
into other programs using REXX. If no operands are given, lp3820 will
prompt for some basic options. Options can start with either a dash (-)
or a slash (/).
lp3820 file printer -options
file The name of an AFP document. If no extension is specified it
defaults based on the setting of AFPEXT. The file name can be
a dash (-) to indicate standard input.
printer The name of a printer entry in lp3820.pro
-? Show brief command help
-?? About lp3820. Show the author and copyright notices for lp3820.
-f file: Override the printer port. The operand is a filename. The
file name can be either the next operand, or part of the current
operand following a colon or equals. A dash (-) indicates stdout.
The following are all valid:
-f outfile.ps
-file:lpt2
/f=c:\temp\out.pcl
-f:-
-p Page range: Specify a range of pages to print. This takes one or
two page names as operands. These can be specified as * to
indicate the start or end of the document. If only one page is
specified, then only that page is printed. The pages must be
separate operands. Be careful not to put the printer name after
a single page, it will be considered the ending page number.
These are all valid page ranges:
-p 2
-p 3 5
-page iii 3-19
/p 5 *
-pn Page number range: Specify a range of pages to print as a start
number and count. This can be combined with the -p option to
create a full set of possibilities. The first operand is the
number of the page to start with. The second operand is the
count of pages. If the count is not given, it defaults to one.
These are all vaid page number ranges:
-pn 2
-p 2 -pn 1 5
/pn 5 2
-co Copies: Specify a number of copies. The copy count is a separate
operand, or follows a equal (=) or colon (:). This value is put
into the datastream, and it is up to the printer to honor this
count. Normally, this will cause the copies to come out
uncollated (n copies of each page).
These are valid copies:
-co=3
-co:2
/copies 3
-q Quiet: Do not give status information. If this is selected, only
fatal error messages will cause any output. This is designed to
be used when lp3820 is being used without the user being aware
of it.
-d Debug: Show additional messages. This should be used when modifying
the profile, or when trying to determine why lp3820 is not
giving you the expected results. Normally errors in the profile
are just ignored.
-s Source: Specify the paper source as 1, 2, or M. Two sources can be
specified, the first is used for the first page, and the second
from subsequent pages. If only one paper source is given, it is
used for all pages. The value is put into the data stream, and
it is up the the printer to use it. By default, the hardware
default paper source is used. Examples of valid paper source
specifications are:
-s2
-s21
/sm1
-odd Print only odd pages. This can be used as part of a two pass
duplex.
-even Print only even pages. This can be used as part of a two pass
duplex.
-a Average sync: this gives the best appearance and smaller data
stream, and is thus the default, but it only works for PostScript.
For other datastreams this is the same as char sync.
-c Character sync: set cursor position for each character This is
the normal default, and need not be specified unless the printer
entry was changed.
-n No sync: set cursor position only on absolute moves. This
creates a smaller output file, but the results can look very
strange if the font substitution is not exact.
-dx Duplex: Force the hardware duplex option.
-ns No scale: Do not scale the image, but put out the entire page
as if it were a 300 dpi document. This is useful for documents
with full page images such as the output from PS/370. This
option also sets a -200 left margin.
-ni Small images: Do not scale the image, leaving it smaller, but
make the text the normal size. The image is aligned at the
upper left corner on the physical page.
-cg=# Copy group: This is used for suppression support, and specified
which copy this represents.
-r Resident: Assume that all fonts are resident. This option causes
no fonts to be downloaded. This should only be used if you have
an external resource manager to download fonts. In fact, you are
better off never using this option, since it means that internal
fonts will not be downloaded, and the resource manager has no
access to them.
-x Extract: This allows files within lp3820.ftb to be extracted.
This is useful to see or modify the internal files. For
instance to see the standard 4029 profile you can do:
lp3820 -x !std4029
This creates the file !std4029.pro. You can modify this and
update your profile entry to use the new file instead of the
internal !std4029.
-xl Extract list: This gives a list of all files which can be
extracted using the -x option.
-z Send messages to stdout instead of stderr. This allow the
redirection of stdout in system which do not allow stderr
to be redirected.
lp3820 Functions
================
Page Names:
In AFP, page names are an 8 character string. The page name is given
in the start and end page controls. lp3820 uses this name to show
progress, and to allow selection of a range of pages to print.
Although the page names are often numeric, they are not always so. It
is very common to start a document with roman numerals. When using
folio by chapter, the page name contains the chapter name, and some
punctuation. It is also possible to have duplicate page names.
lp3820 treats the 8 characters as a string, and matches against it in a
case independent manor (thus ii and II are the same). If there are
duplicate page names, only the first one is selected as a begin page,
and the first occurrence after the begin is selected as the end page.
If you do not know the page names of a document, try the following:
lp3820 file.afp text >nul -p 9999
This will show you a list of all the pages in the document.
Duplex:
You can use the duplex function of your printer by setting the duplex
option of the printer entry to "on" or "tumble". Using the -dx option
on the command line sets duplex to on. Hardware duplex will be ignored
on printers which do not have a duplex option.
Most personal page printers do not have a duplex function, but this can
be simulated by writing every other page, and putting the paper thru the
printer twice.
You can also specify that only half of the pages are printed by using
the -even or -odd options. To create duplex, you would normally first
print the even pages, and then rerun lp3820 to print the odd pages.
Note: Even and odd refer to pages within the page range, and not to
whether the page number is even or odd. If you start the range with
an even page number, then the odd pages will have even numbers printed
on them. Also, when using page sets, the first n pages are odd.
Note: Sending the paper multiple times thru the printer is not
officially supported, although it seems to work OK on most printers. If
you have a problem with paper curl, using duplex will probably make it
much worse.
Top and Left Margins:
The settings for top and left margins are an attempt to compensate for
the fact that the printable area on most personal page printers is
smaller than the 3820. It also compensates for the fact that printers
in HP mode do not measure from the paper edge, but from the printable
edge, which varies by model. The value specifies the amount to move the
page to the top or left on the paper. Since it is most normal to want
to move the contents down and to the right, these values are often
specified as negative.
Top and left refer to the top and left of the page as it moves thru the
printer, not the top and left of the text. The exception to this is
4019 landscape mode. Since the 4019 does not correctly implement
orientation, the orientation change is faked using landscape
orientation, and the top and left are based on landscape orientation.
Font Compression:
The fonts shipped with lp3820 are compressed PPDS fonts. To use them
in other utilities, you need to first decompress them. lp3820 will
use either the compressed or decompressed versions. You can decompress
them using the -x option of lp3820 and giving the font name as:
lp3820 -x helv12.dlf
PostScript Multi-up:
When using PostScript, it is possible to print multiple logical pages
on the same physical page. This is known as multi-up (as in 2-up or
4-up). This function does not work in PPDS or HPPCL modes. There
are several parameters including the scale factors, rules, and
shadows which can be specified. Modify the "multiup" entry in the
profile to make these changes.
A special case of multi-up is 1-up, which performs the automatic scaling
of page to paper. This will make a small page fill the paper, or make
a large page fit on the paper.
lp3820 Profile
==============
The lp3820 profile is kept in the file lp3820.pro. For examples of the
items discussed below, you should look in this file.
Syntax of profile entries
-------------------------
The profile is made up of lines. On each line is either a comment or a
profile entry. Lines starting with an blank, tab, or asterisk (*) are
comments. Profile entries have a keyword starting at the beginning of
the line. The keyword can be in any case. The keyword is followed by
an optional equal sign, and operands. Any characters following the last
operand on a line are ignored, and can be used as comments. In entries
with an undetermined number of operands, an operand starting with '<'
is normally treated as the start of a comment.
Global Profile Entries
----------------------
Global profile entries allow the setting of lp3820 program global
setting. Since there is only one location to set, it only makes sense
to have one of each of these. Many includeall entries can be used.
DEFAULT
A default entry defines the default printer entry to use if none is
specified on the lp3820 command. The first printer found whose names
has been specified as the default is used as the printer definition. A
single operand gives the name of the printer description.
AFPEXT
An afpext entry defines the default extension for the input apf file if
it has no extension. The operand is a name, and should start with a
dot. The default is to use .afp. Only the last fontext entry found
in the profile is used. This must be placed before the first printer
description.
FONTEXT
A fontext entry defines the default extension for soft fonts for which
no file name is given. The operand is a name, and should start with a
dot. The default is to use .dlf. Only the last fontext entry found
in the profile is used.
PSEGEXT
A psegext entry specifies the extension to be used for external PSEGs
found in the datastream. The operand is a name, and should start with a
dot. The default is to use .pse which is the default extension created
by the download. Only the last psegext entry found in the profile is used.
OVLYEXT
A ovlyext entry specifies the extension to be used for external overlays.
The operand is a name, and should start with a dot. The default is to
use .ovl which is the default extension created by the download. Only
the last ovlyext entry found in the profile is used.
INCLUDEALL
An includeall entry allows an extension of the profile. This include is
done regardless of whether the current printer entry is selected. Up to
four levels of includes are allowed. The include facility is used by
the system to define standard definitions used by all printer entries.
PATH
A path entry allows the specification of an additional path to use
in searching for files. This can be used to specify where additional
font files are located. This is designed to be used in LAN situations
so that each user does not need to set an LP3820 environment variable.
METRICS
A metrics entry allows multiple .ftb files to be used. You should
normally include lp3820 as the first entry in the list. You may have
up to four metrics entries in the list. This entry must precede the
first include or printer description.
Note: This entry allows additional function to be shipped as separate
packages. Currently, there are no such packages available outside IBM.
Printer Description Entries
---------------------------
Printer Description Entries exist within a printer description, and only
have effect for that printer. These entries are used to describe a
particular printer. These are stanzas in Unix terminology.
PRINTER
A printer entry defines a printer description. The printer description
starts with a printer entry, and continues until the next printer entry
or end of file. There is a single operand, which is the name of the
printer description. This can be 1 to 16 characters, and case is
ignored. You can have as many printer descriptions as desired.
A particular printer description may be used by giving this name as the
second name on the lp3820 command.
TYPE
A type entry defines the type of printer, which is used to create
different data streams. If an incorrect type is used, the result will
probably be garbage on the screen.
There is a single operand, which gives the type. The following types
may be used:
4019 IBM LaserPrinter 4019 in PPDS mode.
4029 IBM LaserPrinter 4029 in PPDS mode.
hp HP LaserJet II or compatible (including 4019 in HP mode)
hp3 PCL5 (HP LaserJet III and IBM LaserPrinter 4039)
hp4 PCL5 extended (HP LaserJet 4)
ps Any printer in PostScript mode
4216hp HP LaserJet+ emulation of the 4216 with scalable fonts
text Use no printer, but just extract the text
If you have a 4029, it is best to use the 4029 PPDS support, although
the 4019 and HP support will also work.
The HPPCL (hp) support works on all HP LaserJet II and above printers
(including the LaserJet III and LaserJet 4), and all of the compatible
printers. It partially works on on LaserJet+ printers. The PCL5
support gives a full function support for scalable fonts and mixed
orientation documents.
PostScript is generally slower than either PPDS or HPPCL, especially
when doing images. PostScript does support multi-up and correct
page scaling.
PORT
A port entry gives the name of the file to which the output is to be
written. This is normally the name of a printer device file, but may be
any disk file. These is a single operand, which is a file name.
If the name begins with a period, it is treated as an extension, and
this extension replaces the extension of the input file to create the
output file name. This is normally used when the output is to a disk
file.
A single hyphen (-) indicates that the output should be sent to standard
output. This is the normal form in Unix.
This entry is overridden by the -f option on the command line.
SETUP
The setup option allow the specification of printer specific controls to
be added to the datastream. This should be done with care as it could
cause the file not to print. Three setup string locations are
supported:
1 At the very start of the file (before the reset)
2 During document setup
3 At the beginning of each page.
4 At the very end of the file (after the reset)
There are two operands to the setup option. The first specifies which
string. The second gives the string to send to the printer. This can
be flat text, or escape sequences. An escape sequence consists of a
backslash followed by either two hex digits, or the a special character
from the list below:
\ Insert a backslash (0x5c)
( Insert an escape (0x1b)
n Insert a line feed (0x0a)
r Insert a cariage return (0x0d)
Note: The setup string is output in ASCII, and will not give correct
results in TEXT mode on an EBCDIC machine.
TOP
A top entry moves the text vertically on the page. This is designed to
compensate for any automatic margin added by the printer. It can also
be used to compensate for the fact that many printers do not allow
marking in the top .25 inch of the page. This can also be used to
match the compensation of the 3800-3 printer. There is a single operand
which is a numeric value which represents a number of 1/300i units.
The value is defaulted by printer type, but is zero for most printers.
A positive value has the effect of moving the contents up on the page.
A negative value has the effect of moving the contents down on the page.
Remember that moving the contents so that the top line shows, may cause
the bottom to be not shown. This is because the 3820 has a longer page
than can be printed on most personal laser printers.
LEFT
A left entry moves the text horizontally on the page. This is designed
to compensate for any automatic margin added by the printer. It can
also be used to compensate for printers which do not print all the way
to the left paper edge. There is a single operand which is a numeric
value which represents a number of 1/300i units.
The value is defaulted by printer type. Most HP printers have a
non-zero default. A positive value has the effect of moving the
contents to the left. A negative value has the effect of moving the
contents to the right.
OPTION
An option entry specifies variations on the type. This is mostly used
for PostScript (ps) printers. Note that the name is option (there is
no s at the end). There can be multiple options specified in one entry,
and there can be multiple option entries in a printer description. If
they conflict, the last one specified is used. The following options
are allowed:
aesbin Download images in binary. To use this option, you must set
the printer to binary mode, and must be using AES.
binary Download images in binary. To use this option, you must set
the printer to binary mode, and not be using AES.
7bit Use only 7 bit ASCII codes. Use this option if you are
sending the PostScript over a communications line with
parity.
hex Use hex mode for images. This is the default and cancels
aesbin, binary or 7bit mode. You may generate hex mode
PostScript even if you are running in PostScript binary
mode.
eoj Put out an EOJ (ctrl-d) at the end of the file. This is the
default. noeoj Do not put out an EOJ at the end of the job.
This should be used when the file is not being sent to a
printer.
boj Put out an EOJ (ctrl-d) at the beginning of the file. This
can be used to verify that the previous job is ended, but
can cause confusion to some PostScript routers.
noboj Do not put out an EOJ at the beginning of the file. This
is the default.
sic Place a Set Initial Conditions command at the start of the
datastream. This will force the mode, but make it work only
on an IBM LaserPrinter (4019 or 4029). This gives you the
same affect as AES, in that you can use multiple datastreams
on the same printer. In OS/2, you should not use this
unless your print driver is set to IBMNULL.
nosic Do not write a SIC command. This is the default.
imgcomp Compress images. This is used in PPDS and PostScript. It
works on all 4029s, and late model 4019s. In PostScript,
it should generally not be used since it is slow at the
printer end. (Although this is not the default or the 4029,
it is set in the standard profile for the 4029).
noimgcomp Do not compress images. This is the default for all
printer types.
noscale Do not scale the images, but make the page smaller. You
may also need to set left margin. The top margin takes
care of itself.
smallimg Small images. This is the same as the -ni command option.
top Top align when page size is not the same as paper size
center Center align when page size is not the same as paper size.
This is the default.
bottom Bottom align when page size is not the same as paper size
noalign Act as if the page size was equal to the paper size.
This can give erroneous results for rotated pages, but
works when the page size is set incorrectly.
xtypo Use the extended typographic support. The standard
includes use this as necessary, and it should not be
changed.
nfs Do minimal support for the LaserJet+ (PCL3). This
must be used together with the type 4216hp.
OVERLAY
Specifies an overlay to be used for the first and subsequent pages.
Two operands may be specified. If only one is specified, it is used
for the first page only. An overlay of * may be specified to
indicate no overlay. The default is to use no overlays.
PAPER
A paper entry allows the specification of the paper size in a printer.
This is necessary in the case of PostScript, and 4029 which allows
rotation.
The operands are up to four paper sizes. The first is the default and
paper source 1. The second indicates the size of the second paper
source, the third indicates the size of the manual paper source, and
the fourth gives the size of the third source or automatic envelope.
Missing operands default to the first size specified. If no paper size
is specified, the default is letter
The following are valid paper sizes:
letter Use US size paper (this is the default)
a4 Use Metric A4 size paper
b5 Use Metric B5 size paper
exec Use executive size paper
legal Use US legal size paper
a5 Use Metric A5 size paper
FAMILY
A family entry allows the specification of a scalable font family.
This is used for PostScript and 4029 fonts. Each family entry has
the following entries. The first 5 are required. The rest are
optional, and default as specified.
All fonts names except the base can be specified as a delta from the
base font name. This can be an equal sign (=) to indicate a name equal
to the base, an equal plus characters which appends a hyphen and these
characters to the end of the base name, or a hyphen and some characters,
which replaces the final hyphenated piece of the base name with the
specified characters.
class - The four byte class name (see font below). For a 4029,
monospace fonts should have a minus sign (-) as the
fifth character.
base - The name of the base font of the family.
italic - The name of the italic (or oblique) font of the
family.
bold - The name of the bold font of the family.
italicbold - The name of the italic and bold font of the family.
codepage - The codepage of the font. This must be one of the
internally supported ASCII code pages. This is used to
specify the contents of the font. A zero value
indicates that the font should not be re-encoded. In
general, you should use 850 for the encoded value. For
PostScript, this is the only encoding which works
unless you change the header file. For the 4029, those
code pages supported by both the 4029 and lp3820 can be
used, but the font extensions assume all 850 chars are
in the base font. The default is zero.
hscale - Horizontal scale for non-bold fonts as a percentage.
The default is 100.
bscaleb - Horizontal scale for bold fonts as a percentage The
default is 100.
vscale - Vertical scale. This is a multiplier of the given point
size to actually use. The default is 100.
Note: To see example of the family entry use the -x option to extract
the files !stdps or !std4029.
In PCL5 the font name represents a font selection field. This should
contain the style, bold, and typface values. To select CG Times Bold:
0v3b4101T
Note: In PCL5 (types hp3 and hp4) both vertical and horizontal scaling
is done based on the hscale (or hscaleb). The vertical scale factor is
not used. This is due to a deficiency in the HP-PCL5 font support
which does not provide for separate horizontal and vertical scale
factors.
FORMDEF
Specify the name of the formdef to use. This may override the
settings of left, top, and paper. This can be overridden using
the -fd command line option, or by a formdef within the document.
The operand is a file name (normal path processing is done).
The file can contain any valid afp data.
INCLUDE
An include entry allows you to include printer specific entries. This
include is conditional in that it is only done if the current printer
entry is selected. This has a single operand, which is the file name to
include. This can be an internal file name (given with no extension).
You can extract these internal files using the -x option.
MULTIUP
A multiup entry allows you to control the PostScript multi-up facility.
The entry consist of a number (1, 2, 3, 4, or 8) giving the number of
pages on the paper, followed by keywords and values. The value is
optional, and some keywords do not allow a value.
The following keywords exist, along with the default and possible
values. See lp3820.pro for examples:
rule - Width of the rule. Default = 5 (0 - 200)
shadow - Size of the shadow. Default = 75 (0 - 32)
gray - Color of the shadow. Default = 80 (0 = 100)
scale - Scale page from possible size. Default = 90 (50 - 150)
orient - Orientation. Default = 0 (0, 90, 180, 270)
noshadow - Use no shadow (same as shadow 0)
norule - Use no rule (same as rule 0)
thick - Use thick rule (same as rule 15)
Note: Orientation should normally not be set, as lp3820 tries to
determine it automatically.
SCALE
A scale entry allows a vertical and horizontal scale factor to be
applied to line positions. This can be used to print a document which
is a little too large for the paper. This can be because the 3820 page
size is a little larger, or just because it was formatted for A4, and
you are printing on US paper.
There are one or two operand, and each is an integer in the range 50 to
200, and is a percent scale of the vertical and horizontal axis. The
default if not specified is 100. The best use of this feature is to
allow the printing of documents formatted for A4 on US 8.5x11 (letter)
paper. Since the A4 page is longer, the contents at the end of the page
are often lost. By using a scale factor of about 94, it is possible to
get the entire A4 page onto a letter page.
In PostScript, the scale is correctly implemented to fully scale all
of the contents of the page. For other datastream, fonts are not scaled,
and images may look strange.
Advanced Profile Options
------------------------
These additional profile entries are used less often, but may be
important for advanced usage.
COPIES
A copies entry allows the specification of the number of uncollated
copies to make of each page. The operand is a single numeric value in
the 1 to 99 range. This value is overridden by the /co= command line
option. This value is normally left unset in the profile, and set only
as a command line option.
DUPLEX
A duplex entry allows the specification hardware duplex, or the order
of pages for duplex. The operand is a keyword and can be:
on Use hardware duplex (long side binding)
off Do not use hardware duplex
tumble Use hardware duplex (short side binding)
default Do not specify hardware duplex option
even Print even pages first (the default)
odd Print odd pages first
<num> Give the page set size as a number (1-64)
Even and odd pages are based on the page count, not by examining the
page name. Even printing is most useful for printers with an S paper
path. Odd printing is most useful for printers with a straight paper
path.
The page set size is normally set by using the multiup entry.
MOREFONT
A morefont entry allows the specification of the additional fonts
families which are to be used to satisfy characters which are not found
in the base font. This is done on a per printer description basis. The
default is to use xtyp, and symb. For base fonts not in a standard code
page, the alternate font in codepage 850 is also used. In most cases,
the default morefont selection is correct and should not be changed. If
you include another font family in the list, be sure to have at least
one font entry for this family, which is used to derive the proper
codepage.
SOURCE
A source entry allows the specification of alternate paper source. If
no paper source is specified, then the current paper source is used.
The operands consist of up to two paper sources. The first indicates
the source for the first page. The second indicates the source for all
subsequent pages. Only the first character of the paper source is used.
This can be:
1 Use the primary paper tray
2 Use the secondary paper tray
M Use manual feed
3 Use the third paper source or envelope feed.
PSFONT
A psfont entry allows the specification of a PostScript or 4029 type 1
font to be downloaded to the printer. All PSFONT entries in the printer
description are downloaded in the prolog for PostScript. For 4029, they
are downloaded only if they are used in the job. There are two
operands. The first consists of a soft font identifier without the size
field, and the second is a file name. An attribute of asterisk (*) can
be used to indicate that this applies to all font attributes. The
second operand consists of a file name of the font to be downloaded.
psfont entries apply to a single printer.
PSEGPOS
Specify the position of standalone PSEGs. Since a standalone PSEG does
not have page and position information, this can be specified on a
printer basis. The page size is set to the paper size, and the
position can be set with the PSEGPOS entry.
The entry consists of one or two values which are 1/240 inch units
from the left and top of the page. If only one value is specified,
both left and top are set to this. The default is 120.
PSHEADER
A psheader entry allows the PostScript header file to be modified on a
per printer basis. You should not update this unless you know what you
are doing. This should only be necessary when the names of the standard
fonts are non-standard.
RESERVE
A reserve entry allows font IDs to be reserved. This should be used
when the printer has permanent soft fonts already loaded in the printer.
By default, lp3820 reserves locations 1 thru 7. The operands are a list
of values in the 1 to 99 range, indicating the font IDs which lp3820
should not use.
RESIDENT
A resident entry defines a resident font of the printer. This can be a
builtin font, font card font, or a permanent soft font which is always
loaded before lp3820 is run. There is a single operand which is a soft
font identifier. The resident fonts are normally of minimal use to
lp3820, and very little is gained by specifying them.
SYNC
A sync entry allows the specification of when to synchronize character
position. The soft fonts supplied do not match perfectly the fonts used
on the host such as Sonoran Serif. The resolution of the AFP devices
(240) is also different from the resolution of personal laser printer
devices (300). It is therefore necessary to synchronize positions.
This can be done in three ways:
1. Synchronize by averaging over a word. This gives a good
appearance, and a smaller datastream than character sync, but
it works only in PostScript.
2. Synchronize on each character. This gives the best fidelity,
but does not look the best in some cases. It can also generate
a large data stream.
3. Do no synchronization. Only absolute moves in the source data
stream will cause synchronization. This will give correct
placement of characters for the target font, but alignment and
justification will be incorrect.
The operand is a name. Only the first character is used. This can be
a for average, c for character, and n for no synchronize. This entry
can be overridden by the -c and -n command line options. In most
cases, the average synchronization looks best, and this is the
default.
Font Mapping Entries
--------------------
Font Mapping Entries do not exist within an printer description, but
apply to all printers.
To map a from an AFP font to a soft font, lp3820 needs the following
information:
■ The width of each character in the font
■ The font class, size, and attribute to substitute
■ The file name of the soft font
■ The code page and contents of the soft font
There are two places it gets this information.
1. The file lp3820.ftb contains a list of supported AFP fonts, as well
as metrics, and default substitution tables.
2. Font mapping entries in the lp3820.pro allow for adding and
overriding entries in lp3820.ftb.
FONT
A font entry declares the existence of a soft font, and gives the file
name which contains it. There must be a font entry for each soft font
installed on your system. If you use the fonts shipped with lp3820, or
rename you fonts to the default names, you do not need to specify a file
name. A soft font is identified by a name which is made up of three
parts:
1. The font class given as a four byte name
2. The font size in points given as a two digit value
3. The font attribute, given as a single character
Example font identifiers are: time12, helv18b, xtyp08.
The font classes are derived from the HPPCL font classes, and are given
a four character name. The case of the name is ignored. The following
classes may be used:
line 0 - Line Printer
pica 1 - Pica
elit 2 - Elite
cour 3 - Courier
helv 4 - Helvetica
time 5 - Times Roman
lgot 6 - Letter Gothic
scri 7 - Script
pret 8 - Prestige
pret 9 - Caslon
orat 10 - Orator
pres 11 - Presentor
essa 12 - Essay
seri 13 - Serif
futu 14 - Futura
pala 15 - Palatino
souv 16 - Souvenir
opti 17 - Optima
gara 18 - Garamond
coop 19 - Cooper
coro 20 - Coronet
broa 21 - Broadway
hebr 22 - Hebrew *
cent 23 - Century Schoolbook
unvr 24 - University
helo 25 - Helvetica Outline
futn 26 - Futura Narrow
kori 27 - Korinna
reve 28 - Reverse monospace *
cloi 29 - Cloiser
gall 30 - Galliard
avan 31 - Avant Garde
xtyp 33 - Extended typographic *
logo 34 - IBM Logo *
olde 35 - Old English (Windsor)
heln 36 - Helvetica Narrow
helx 37 - Helvetica Extra Narrow
yasm 37 - Hebrew
bask 39 - Baskerville
garn 40 - Garamond Narrow
news 41 - News Gothic
goud 42 - Goudy
chan 43 - Chancery
clar 44 - Clarendon
ding 45 - Dingbats
apl2 46 - APL2 *
book 47 - Bookman
sser 48 - Sonoran Serif *
ssse 49 - Sonoran Sans Serif *
hebm 50 - Hebrew monospace *
gill 51 - Gill Sans
univ 52 - Univers
rock 54 - Rockwell
hebh 55 - Hebrew Helvetica *
bgot 56 - BookMaster Gothic *
symb 137 - Symbol
symm 138 - Symbol monospace
Names marked with an asterisk (*) are private to lp3820. lp3820 will
automatically compute the FGID from the font class. You can also use
the names fnt followed by a single digit (fnt0, fnt1, etc.). These are
designed to allow font mapping without using an actual font name. The
font size is given as an two digit value. When the value is less than
10, the leading zero must be used.
The font attribute is a single character, and can be one of the following:
Base font attribute (can also be given as N).
I Italic or Oblique
B Bold
X Bold and Italic (or oblique)
AFPFONT
A afpfont entry allows the addition or modification of font entries in
lp3820.ftb. This provides lp3820 with metrics and substitution
information. There are three operands, the name of the font to define,
the name of a font to use for metrics, and the soft font identifier for
the substitution information. AFP font names are usually eight bytes
long starting with C0. DCF mostly uses the 3800 form of the name, in
which the second character indicates direction. Upright fonts thus
start C1. You can use either form of the name. You can find the names
of fonts by looking in the file FONT3820 LISTING which should be on the
same disk that the AFP fonts are located.
CODEPAGE
A codepage entry defines the code page for subsequent font entries.
This should match the actual code page of the font, and indicates both
the translation and character contents of the font. The single operand
is a name.
The following values are supported internally by lp3820. These same
values can be used in other locations where internally supported ASCII
code pages are required.
850 Full international character set
850a International with typographic characters
850p International publishing characters
850s International PostScript set
rom8 Font in HP order, no box corners or publishing chars
win Font in Windows (ISO) order, no box corners
437 US English PC
437a US English PC typographic subset
437b US English PC small subset
437d HP Danish variant of 437
819 ISO Latin 1
1004 Desktop publishing
symb PostScript Symbol
syma PostScript Symbol without multi-part characters
862 Hebrew variant of 437
hebr Hebrew characters only
apl2 APL 2
xtyp lp3820 extended typographics
If the operand is not one of these, it is used as a file name to find a
.ftt (font translation table) file. This can be an internal file
(within lp3820.ftb), or an external file.
Note: the tools to create .ftt and .fwt files are currently IBM
internal use only tools. These files can be extracted from
lp3820.ftb.
AFPCODE
The AFPCODE entry allows you to specify the existence of a code page not
internally supported by lp3820. The operands are the name it is known
by in AFP, and the file name of the .ftt file. AFP code page names
normally start with T1.
AFPCF
The AFPCF entry allows you to specify a coded font. DCF does not use
coded fonts, but other AFP producers do. A coded font consists of a
font and a codepage. The entry is the name of the coded font (which
normally starts with an X), the name of a font (which normally starts
with a C) and the name of a codepage (which normally starts with a T).
For example:
afpcf x1gt10 c0d0gt10 t1d0base
lp3820 Errors
=============
lp3820 gives a termination message, and also returns a return
code which can be checked by the caller. The following return
codes are possible:
0 - Document completed, no warnings
1 - Exit from help
2 - Unable to open input document
3 - Unable to open profile
4 - Unable to open PostScript header file
5 - Unable to open output file
6 - Unable to open font metrics file
7 - Version mismatch between lp3820 and metrics
8 - Unable to find default font (metrics file error)
9 - Printer description not found
10 - Invalid structured field (not an AFP document)
11 - Zero length structured field (not an AFP document)
12 - Invalid text control
16 - Unsupported document type
18 - Too many download fonts
19 - Out of memory
20 - lp3820 completed with warnings
21 - lp3820 completed with errors
27 - Error entry in profile
28 - Extract file not found or not valid
29 - Extract output file error
30 - Extract output font error
223 - Version return from -?? option
Notes:
======
lp3820 has been available within IBM since August 1990, and has a
large number of users. The version number reflects eight major
releases of the tool within IBM. Profiles and metrics tables from
before version 2.2 cannot be used with version 2.3.
This tool is offered "asis" without any claim of suitability and without
any warranties. Use and distribution is governed by the license which
is included in the file LICENSE.TXT.
IBM has a product - Print Services Facility/2 (PSF/2) - which is
a complete implementation of AFP in the OS/2 LAN environment. In
contrast, lp3820 is an smaller implementation without as much document
checking, and runs in DOS or OS/2. PSF/2 supports the attachment
of AFP printers to a PS/2.
lp3820 was not developed as an IBM product, or as the part of any
product. It is the work of one person in my spare time. You are free
to send me comments, but I cannot promise to respond. (In fact, I may
not be able to since the internet routing tables are not necessarily
bi-directional).
Ken Borgendale - 27 May 1993
kwb@vnet.ibm.com
IBMMAIL: USIB4KWB