dtlp(1)

NAME
dtlp - gather lp arguments and print a file

SYNOPSIS
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]

DESCRIPTION
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:

    By default, dtlp posts a Print dialog that appears with Print, Cancel, and Help pushbuttons. 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.

  The Print Dialog
When invoked normally, dtlp posts a Print dialog that shows:

    The name of the file to print (a read-only text label). 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. The number of copies to print. The default is 1. The title to appear on the printed banner page, and if formatted, in the header of each page. A checkbox to indicate whether the file should be printed formatted (run through the pr -f command) or printed unformatted. 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).

OPTIONS
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.

  Command Line Options and the ENVIRONMENT Setting
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.

  Command Line Options

    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. Set the printer destination for the file. Use this value as the path name of the lp print command. The default is lp. Print this many copies. Default is 1. Pass these options directly through to the print_command, without any interpretation. This setting is intended for users with advanced printing knowledge. 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. Causes the file to be formatted with the man command. If set, then other formatting specifications (such as -r) are ignored. 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. Print out a help message. Format the file before printing it, by running it through the pr -f command. Print the file silently, without posting the Print dialog. Equivalent to the DTPRINTSILENT setting under the ENVIRONMENT heading in this man page. Print out verbose messages during the print process. 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 this file. If print_file is not supplied, standard input is assumed.

ENVIRONMENT
Following are the names and meanings of the environment values that affect the operation of dtlp:

    Use the specified value to determine the locale of the message strings that appear in the Print dialog. Use the specified value as the printer destination for the file. 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. Equivalent to the -e command line setting. Value must be True or False (case is ignored). Default is False. Equivalent to the -s command line setting. Value must be True or False (case is ignored). Default is False. Equivalent to the -u command line setting.

  Reconciling Options
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.

RETURN VALUES

    Command completed successfully. The user pressed the Cancel button. Usage error. There is no specified file to print. Unable to find the dtksh initialization file, /usr/dt/scripts/DtFuncs.sh. The file is an invalid file (for example, a directory or a device file). The user has no read permission on the file.

EXAMPLES

  Command Line
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

  Action Definition
The following Print action would cause a PCL file to be printed using the dtlp command.

    ACTION 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.

    ACTION 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.

LOCALES AND CODESETS
The strings that appear in the Print dialog are localizable.

FILES

    Defines the default system Print action. Defines the default Print actions for man pages (type MAN), ASCII files (type TEXTFILE), PCL files (type PCL), and PS files (type POSTSCRIPT). The datatype files that implement the per-printer Print action; these are created by the dtprintinfo -populate command. The dtksh initialization file that defines a number of GUI convenience functions, as for creating a dialog box.

BUGS
The dtlp Print dialog cannot accept quote marks (either ' or ") in the Banner Page Title text field.

SEE ALSO
dtsearchpath(1), dtprintinfo(1).