This is the 'lpr' compatible command line frontend to make use of features of libcapsclient. If you want to use this command in your console, just do it.
- Note
- A CAPS universe specific variant of this command with more features is capsdoprint.
- Attention
- Developers! If you want to use this command from within your application, don't do it. Use libcapclient instead. Really. Refer Client side API description for details.
Usage:
$ lpr [options] <document>
- <document> is the document's file name
- Relevant options are:
- -P <target> / --printer <target> Print the document on this named printer.
- -# <number> Set the amount of copies to print. Default is '1'.
- -o <param> / --option <param> Printing parameter (IPP style). Can be used more than once. All <params> are concatenated.
- -i \ --help A shot help text
- --version Output the tool's release version
- Ignored options are (just for compatibility):
- -H <server:port> / --host <server:port> Specifies a server and its network port to send the job to.
- -E / --encryption Ignored.
- T <name> / --title <name> Define title of this job.
- -C <name> Same as '–title/-T'
- -J <name> \ --name <name> Define name of this job.
- -U <user> Specifies an alternate username.
- -h Suppress the printing of the burst page.
- -l Use a filter which allows control characters to be printed and suppresses page breaks.
- -m Send mail upon completion.
- -p Use external program to format the files.
- -q Queue the print job, but do not start printing.
- -r Remove the file upon completion.
- Note
- IPP style means space separated strings. See below.
If you have only one printer attached and known by your host, you simply can print a whole document with:
$ lpr this_document.pdf
If more than one printer is known to the system, you must define the printer to print the document on.
$ lpr this_document.pdf -P "some printer name"
Defining the printers this way implies you know theri names. Refer capsprinter how to retrieve their names.
- Note
- There is no such thing like a default printer.
If you want to print in a special way, you can add so called printing parameters with the -o parameter. This parameter accepts key strings or key=value string pairs, each defining a special part of the printing process, based on the key string.
$ lpr this_document.pdf -o="page-ranges=4-8,10 quality=4" -o sides=one-sided
- Note
- More than one
key and/or key=value pair must be separated by spaces. Thus, you will need to quote the value part of this parameter, like -o "key1 key2=val2". Or you can give the -o parameter more than once. All strings are concatenated.
-
You can find here a list of supported printing parameters.