Table of Contents
dtlp -- gather lp arguments and print a file
dtlp [-b banner_title]
[-d lpdest] [-m print_command] [-n copy_count] [-o other_options] [-u user_filename]
[-a] [-e] [-h] [-r] [-s] [-v] [-w] [print_file]
The dtlp command
line utility is a front-end to the lp subsystem. The dtlp utility gathers
lp print options and prints a specified file. It operates in two modes:
- GUI mode
- By default, dtlp posts a Print dialog that appears with Print,
Cancel, and Help pushbuttons.
- Silent mode
- When invoked with the silent flag,
dtlp does not present the GUI input dialog. It collects input arguments
from the command line and environment variables.
When invoked
normally, dtlp posts a Print dialog that shows:
- File
- The name of the file
to print (a read-only text label).
- Printer
- The printer device. The default
is the value of the LPDEST environment variable. If LPDEST is unset, then
the properly localized string Default appears in the text field.
- Copies
- The
number of copies to print. The default is 1.
- Banner Page Title
- The title to
appear on the printed banner page, and if formatted, in the header of each
page.
- Print Page Numbers
- A checkbox to indicate whether the file should be
printed formatted (run through the pr -f command) or printed unformatted.
- Print Command Options
- Any options to be passed directly to the lp command.
For example, some implementations support the -o2 option to lp to enable
double-page printing.
- When the user presses the Print button, these settings
are
- passed onto the lp subsystem, along with the values of any other environment
settings (see the ENVIRONMENT heading in this man page).
The dtlp
command accepts a print_file name specification. If a print_file is not
specified, standard input is assumed. When used in this fashion, the -u user_filename
option can be used to pass a name to dtlp for display in the Print dialog.
The dtlp command is sensitive
to some ENVIRONMENT settings. In the case in which both a command line option
and a complementary environment setting are specified, the command line
option takes precedence.
- -b banner_title
- Set the string
used in printing the banner on the title page. If the -r option is also specified,
then print this same string on the page headers.
- -d lpdest
- Set the printer
destination for the file.
- -m print_command
- Use this value as the path name
of the lp print command. The default is lp.
- -n copy_count
- Print this many copies.
Default is 1.
- -o other_options
- Pass these options directly through to the
print_command, without any interpretation. This setting is intended for
users with advanced printing knowledge.
- -u user_filename
- Use this value as
the name of file as it should appear in the Print dialog or print output.
Default is print_file. Equivalent to the DTPRINTUSERFILENAME setting under
the ENVIRONMENT heading in this man page.
- -a
- Causes the file to be formatted
with the man command. If set, then other formatting specifications (such
as -r) are ignored.
- -e
- Remove the file after printing it. This functionality
is intended for temporary files generated by applications that don’t need
to persist beyond the act of printing. Equivalent to the DTPRINTFILEREMOVE.
- -h
- Print out a help message.
- -r
- Format the file before printing it, by running
it through the pr -f command.
- -s
- Print the file silently, without posting the
Print dialog. Equivalent to the DTPRINTSILENT setting under the ENVIRONMENT
heading in this man page.
- -v
- Print out verbose messages during the print process.
- -w
- Causes output to the printer to be sent raw, with no interpretation of
tabs, backspaces, formfeeds, and binary characters. Useful for printing
PCL and PS files. If set, then other formatting specifications (such as
-r) are ignored; however, the -a option will take precedence over this setting.
- print_file
- Print this file. If print_file is not supplied, standard input
is assumed.
Following are the names and meanings of the environment
values that affect the operation of dtlp:
- LANG
- Use the specified value to
determine the locale of the message strings that appear in the Print dialog.
- LPDEST
- Use the specified value as the printer destination for the file.
- DTPRINTCWD
- If
set to an existing, usable directory, this setting causes dtlp to execute
the lp command pipeline from that directory. By default, uses the current
directory from which dtlp is invoked.
- DTPRINTFILEREMOVE
- Equivalent to the
-e command line setting. Value must be True or False (case is ignored). Default
is False.
- DTPRINTSILENT
- Equivalent to the -s command line setting. Value must
be True or False (case is ignored). Default is False.
- DTPRINTUSERFILENAME
- Equivalent
to the -u command line setting.
In the case of conflicting
formatting options, dtlp uses the following decisions to reconcile them:
-
- If any raw (as with -w), or man (as with -a) options are specified, all
other page formatting and numbering options are turned off; otherwise,
page printing and formatting are allowed.
-
- In a formatted operation: If
a banner title is specified (as with -b), it will be used as the page header.
-
- If a user filename is specified (as with -u or DTPRINTUSERFILENAME),
it will be used as the page header; otherwise, the filename itself will
be used as the page header.
- 0
- Command completed successfully.
- -1
- The user pressed the Cancel button.
- 2
- Usage error.
- 3
- There is no specified
file to print.
- 4
- Unable to find the dtksh initialization file, /usr/dt/scripts/DtFuncs.sh.
- 5
- The file is an invalid file (for example, a directory or a device file).
- 6
- The user has no read permission on the file.
The following
command line causes dtlp to post a Print dialog for file1 with a name displayed
of Your File and with the default printer chosen: /usr/dt/bin/dtlp -u "Your
File" file1 The following command line causes dtlp to silently print two
copies of file2 on printer laser3: /usr/dt/bin/dtlp -n 2 -d laser3 -s file2
The following Print action would cause a PCL file to be
printed using the dtlp command.
CWACTION Print
{
LABEL Print
ARG_TYPE PCL
TYPE COMMAND
WINDOW_TYPE NO_STDIO
EXEC_STRING /usr/dt/bin/dtlp -w %Arg_1%
}
The following Print action would cause a man page file to be printed using
the dtlp command.
CWACTION Print
{
LABEL Print
ARG_TYPE MAN_PAGE
TYPE COMMAND
WINDOW_TYPE NO_STDIO
EXEC_STRING /usr/dt/bin/dtlp -a %Arg_1%
}
By default, these actions will post the Print dialog.
The
strings that appear in the Print dialog are localizable.
- /usr/dt/appconfig/types/C/print.dt
- Defines
the default system Print action.
- /usr/dt/appconfig/types/C/dt.dt
- Defines the
default Print actions for man pages (type MAN), ASCII files (type TEXTFILE),
PCL files (type PCL), and PS files (type POSTSCRIPT).
- /etc/dt/appconfig/types/C/*.dt
- The
datatype files that implement the per-printer Print action; these are created
by the dtprintinfo -populate command.
- /usr/dt/scripts/DtFuncs.sh
- The dtksh
initialization file that defines a number of GUI convenience functions,
as for creating a dialog box.
The dtlp Print dialog cannot accept quote
marks (either ’ or ") in the Banner Page Title text field.
dtsearchpath(1)
,
dtprintinfo(1)
.
Table of Contents