1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474
|
<HTML>
<!-- SECTION: Getting Started -->
<HEAD>
<TITLE>Printing and Options</TITLE>
</HEAD>
<BODY>
<P>CUPS provides both the System V (<A
HREF="man-lp.html">lp(1)</A>) and Berkeley (<A
HREF="man-lpr.html">lpr(1)</A>) printing commands for printing
files. In addition, it supported a large number of standard and
printer-specific options that allow you to control how and where
files are printed.</P>
<H2 CLASS="title"><A NAME="BASICS">Printing Files</A></H2>
<P>CUPS understands many different types of files directly,
including text, PostScript, PDF, and image files. This allows you
to print from inside your applications or at the command-line,
whichever is most convenient! Type either of the following
commands to print a file to the default (or only) printer on the
system:</P>
<PRE CLASS="command">
lp filename
lpr filename
</PRE>
<H3><A NAME="PRINTER">Choosing a Printer</A></H3>
<P>Many systems will have more than one printer available to the
user. These printers can be attached to the local system via a
parallel, serial, or USB port, or available over the network. Use
the <A HREF="man-lpstat.html">lpstat(1)</A> command to see a list
of available printers:</P>
<PRE CLASS="command">
lpstat -p -d
</PRE>
<P>The <CODE>-p</CODE> option specifies that you want to see a
list of printers, and the <CODE>-d</CODE> option reports the
current default printer or class.</P>
<P>Use the <CODE>-d</CODE> option with the <B>lp</B> command to
print to a specific printer:</P>
<PRE CLASS="command">
lp -d printer filename
</PRE>
<P>or the <CODE>-P</CODE> option with the <B>lpr</B> command:</P>
<PRE CLASS="command">
lpr -P printer filename
</PRE>
<H3><A NAME="DEFAULT">Setting the Default Printer</A></H3>
<P>If you normally use a particular printer, you can tell CUPS to
use it by default using the <A
HREF="man-lpoptions.html">lpoptions(1)</A> command:</P>
<PRE CLASS="command">
lpoptions -d printer
</PRE>
<H3><A NAME="PIPE">Printing the Output of a Program</A></H3>
<P>Both the <B>lp</B> and <B>lpr</B> commands support printing
from the standard input:</P>
<PRE CLASS="command">
program | lp
program | lp -d printer
program | lpr
program | lpr -P printer
</PRE>
<P>If the program does not provide any output, then nothing will
be queued for printing.</P>
<H3><A NAME="WITHOPTIONS">Specifying Printer Options</A></H3>
<P>For many types of files, the default printer options may be
sufficient for your needs. However, there may be times when you
need to change the options for a particular file you are
printing.</P>
<P>The <B>lp</B> and <B>lpr</B> commands allow you to pass
printer options using the <CODE>-o</CODE> option:</P>
<PRE CLASS="command">
lp -o landscape -o scaling=75 -o media=A4 filename.jpg
lpr -o landscape -o scaling=75 -o media=A4 filename.jpg
</PRE>
<P>The available printer options vary depending on the printer.
The standard options are described in the "<A
HREF="#OPTIONS">Standard Printing Options</A>" section
below.</P>
<H3><A NAME="COPIES">Printing Multiple Copies</A></H3>
<P>Both the <B>lp</B> and <B>lpr</B> commands have options for
printing more than one copy of a file:</P>
<PRE CLASS="command">
lp -n <I>num-copies</I> filename
lpr -#<I>num-copies</I> filename
</PRE>
<P>Copies are normally <EM>not</EM> collated for you. Use the
<CODE>-o Collate=True</CODE> option to get collated copies:</P>
<PRE CLASS="command">
lp -n <I>num-copies</I> -o Collate=True filename
lpr -#<I>num-copies</I> -o Collate=True filename
</PRE>
<H2 CLASS="title"><A NAME="CANCEL">Canceling a Print Job</A></H2>
<P>The <A HREF="man-cancel.html">cancel(1)</A> and <A
HREF="man-lprm.html">lprm(1)</A> commands cancel a print job:</P>
<PRE CLASS="command">
cancel <I>job-id</I>
lprm <I>job-id</I>
</PRE>
<P>The <I>job-id</I> is the number that was reported to you by
the <B>lp</B> command. You can also get the job ID using the <A
HREF="man-lpq.html">lpq(1)</A> or <A
HREF="man-lpstat.html">lpstat</A> commands:</P>
<PRE CLASS="command">
lpq
lpstat
</PRE>
<H2 CLASS="title"><A NAME="OPTIONS">Standard Printing Options</A></H2>
<P>The following options apply when printing all types of
files.</P>
<H3><A NAME="MEDIA">Selecting the Media Size, Type, and Source</A></H3>
<P>The <CODE>-o media=xyz</CODE> option sets the media size,
type, and/or source:</P>
<PRE CLASS="command">
lp -o media=Letter filename
lp -o media=Letter,MultiPurpose filename
lpr -o media=Letter,Transparency filename
lpr -o media=Letter,MultiPurpose,Transparency filename
</PRE>
<P>The available media sizes, types, and sources depend on the
printer, but most support the following options (case is not
significant):</P>
<UL>
<LI><CODE>Letter</CODE> - US Letter (8.5x11 inches, or 216x279mm)
<LI><CODE>Legal</CODE> - US Legal (8.5x14 inches, or 216x356mm)
<LI><CODE>A4</CODE> - ISO A4 (8.27x11.69 inches, or 210x297mm)
<LI><CODE>COM10</CODE> - US #10 Envelope (9.5x4.125 inches, or
241x105mm)
<LI><CODE>DL</CODE> - ISO DL Envelope (8.66x4.33 inches, or 220x110mm)
<LI><CODE>Transparency</CODE> - Transparency media type or source
<LI><CODE>Upper</CODE> - Upper paper tray
<LI><CODE>Lower</CODE> - Lower paper tray
<LI><CODE>MultiPurpose</CODE> - Multi-purpose paper tray
<LI><CODE>LargeCapacity</CODE> - Large capacity paper tray
</UL>
<P>The actual options supported are defined in the printer's PPD
file in the <CODE>PageSize</CODE>, <CODE>InputSlot</CODE>, and
<CODE>MediaType</CODE> options. You can list them using the
<B>lpoptions(1)</B> command:</P>
<PRE CLASS="command">
lpoptions -p printer -l
</PRE>
<H3><A NAME="ORIENTATION">Setting the Orientation</A></H3>
<P>The <CODE>-o landscape</CODE> option will rotate the page 90
degrees to print in landscape orientation:</P>
<PRE CLASS="command">
lp -o landscape filename
lpr -o landscape filename
</PRE>
<P>The <CODE>-o orientation-requested=N</CODE> option rotates the
page depending on the value of N:</P>
<UL>
<LI><CODE>-o orientation-requested=3</CODE> - portrait
orientation (no rotation)</LI>
<LI><CODE>-o orientation-requested=4</CODE> - landscape
orientation (90 degrees)</LI>
<LI><CODE>-o orientation-requested=5</CODE> - reverse
landscape or seascape orientation (270 degrees)</LI>
<LI><CODE>-o orientation-requested=6</CODE> - reverse
portrait or upside-down orientation (180 degrees)</LI>
</UL>
<H3><A NAME="SIDES">Printing On Both Sides of the Paper</A></H3>
<P>The <CODE>-o sides=two-sided-short-edge</CODE> and <CODE>-o
sides=two-sided-long-edge</CODE> options will enable two-sided
printing on the printer if the printer supports it. The <CODE>-o
sides=two-sided-short-edge</CODE> option is suitable for
landscape pages, while the <CODE>-o
sides=two-sided-long-edge</CODE> option is suitable for portrait
pages:</P>
<PRE CLASS="command">
lp -o sides=two-sided-short-edge filename
lp -o sides=two-sided-long-edge filename
lpr -o sides=two-sided-long-edge filename
</PRE>
<P>The default is to print single-sided:</P>
<PRE CLASS="command">
lp -o sides=one-sided filename
lpr -o sides=one-sided filename
</PRE>
<H3><A NAME="JOBSHEETS">Selecting the Banner Page(s)</A></H3>
<P>The <CODE>-o jobsheets=start,end</CODE> option sets the banner
page(s) to use for a job:</P>
<PRE CLASS="command">
lp -o job-sheets=none filename
lp -o job-sheets=standard filename
lpr -o job-sheets=classified,classified filename
</PRE>
<P>If only one banner file is specified, it will be printed
before the files in the job. If a second banner file is
specified, it is printed after the files in the job.</P>
<P>The available banner pages depend on the local system
configuration; CUPS includes the following banner files:</P>
<UL>
<LI><CODE>none</CODE> - Do not produce a banner page.
<LI><CODE>classified</CODE> - A banner page with a "classified"
label at the top and bottom.
<LI><CODE>confidential</CODE> - A banner page with a
"confidential" label at the top and bottom.
<LI><CODE>secret</CODE> - A banner page with a "secret" label
at the top and bottom.
<LI><CODE>standard</CODE> - A banner page with no label at the
top and bottom.
<LI><CODE>topsecret</CODE> - A banner page with a "top secret"
label at the top and bottom.
<LI><CODE>unclassified</CODE> - A banner page with an
"unclassified" label at the top and bottom.
</UL>
<H3><A NAME="PAGERANGES">Selecting a Range of Pages</A></H3>
<P>The <CODE>-o page-ranges=pages</CODE> option selects a range
of pages for printing:</P>
<PRE CLASS="command">
lp -o page-ranges=1 filename
lp -o page-ranges=1-4 filename
lp -o page-ranges=1-4,7,9-12 filename
lpr -o page-ranges=1-4,7,9-12 filename
</PRE>
<P>As shown above, the <CODE>pages</CODE> value can be a single page, a
range of pages, or a collection of page numbers and ranges separated by
commas. The pages will always be printed in ascending order, regardless
of the order of the pages in the <CODE>page-ranges</CODE> option.
<P>The default is to print all pages.
<H3><A NAME="PAGESET">Selecting Even or Odd Pages</A></H3>
<P>Use the <CODE>-o page-set=set</CODE> option to select the even or odd pages:</P>
<PRE CLASS="command">
lp -o page-set=odd filename
lp -o page-set=even filename
lpr -o page-set=even filename
</PRE>
<P>The default is to print all pages.
<H3><A NAME="NUMBERUP">N-Up Printing</A></H3>
<P>The <CODE>-o number-up=value</CODE> option selects N-Up
printing. N-Up printing places multiple document pages on a
single printed page. CUPS supports 1, 2, 4, 6, 9, and 16-Up
formats; the default format is 1-Up:</P>
<PRE CLASS="command">
lp -o number-up=1 filename
lp -o number-up=2 filename
lp -o number-up=4 filename
lpr -o number-up=16 filename
</PRE>
<P>The <CODE>-o page-border=value</CODE> option chooses the
border to draw around each page:</P>
<UL>
<LI><CODE>-o page-border=double</CODE>; draw two hairline borders around each page</LI>
<LI><CODE>-o page-border=double-thick</CODE>; draw two 1pt borders around each page</LI>
<LI><CODE>-o page-border=none</CODE>; do not draw a border (default)</LI>
<LI><CODE>-o page-border=single</CODE>; draw one hairline border around each page</LI>
<LI><CODE>-o page-border=single-thick</CODE>; draw one 1pt border around each page</LI>
</UL>
<P>The <CODE>-o number-up-layout=value</CODE> option chooses the
layout of the pages on each output page:</P>
<UL>
<LI><CODE>-o number-up-layout=btlr</CODE>; Bottom to top, left to right</LI>
<LI><CODE>-o number-up-layout=btrl</CODE>; Bottom to top, right to left</LI>
<LI><CODE>-o number-up-layout=lrbt</CODE>; Left to right, bottom to top</LI>
<LI><CODE>-o number-up-layout=lrtb</CODE>; Left to right, top to bottom (default)</LI>
<LI><CODE>-o number-up-layout=rlbt</CODE>; Right to left, bottom to top</LI>
<LI><CODE>-o number-up-layout=rltb</CODE>; Right to left, top to bottom</LI>
<LI><CODE>-o number-up-layout=tblr</CODE>; Top to bottom, left to right</LI>
<LI><CODE>-o number-up-layout=tbrl</CODE>; Top to bottom, right to left</LI>
</UL>
<H3><A NAME="FITPLOT">Scaling to Fit</A></H3>
<P>The <CODE>-o fitplot</CODE> option specifies that the document
should be scaled to fit on the page:</P>
<PRE CLASS="command">
lp -o fitplot filename
lpr -o fitplot filename
</PRE>
<P>The default is to use the size specified in the file.</P>
<BLOCKQUOTE>Note: This feature depends upon an accurate size in
the print file. If no size is given in the file, the page may be
scaled incorrectly!</BLOCKQUOTE>
<H3><A NAME="RAW">Raw or Unfiltered Output</A></H3>
<P>The <CODE>-o raw</CODE> option allows you to send files
directly to a printer without filtering. This is sometimes
required when printing from applications that provide their own
"printer drivers" for your printer:</P>
<PRE CLASS="command">
lp -o raw filename
lpr -o raw filename
</PRE>
<P>The <CODE>-l</CODE> option can also be used with the
<B>lpr</B> command to send files directly to a printer:</P>
<PRE CLASS="command">
lpr -l filename
</PRE>
<H2 CLASS="title"><A NAME="TEXTOPTIONS">Text Options</A></H2>
<P>CUPS supports several options that are only used when printing
plain text files. These options have absolutely no effect on
PostScript, PDF, HP-GL/2, or image files.</P>
<H3><A NAME="CPI">Setting the Number of Characters Per Inch</A></H3>
<P>The <CODE>-o cpi=value</CODE> option sets the number of
characters per inch:</P>
<PRE CLASS="command">
lp -o cpi=10 filename
lp -o cpi=12 filename
lpr -o cpi=17 filename
</PRE>
<P>The default characters per inch is 10.</P>
<H3><A NAME="LPI">Setting the Number of Lines Per Inch</A></H3>
<P>The <CODE>-o lpi=value</CODE> option sets the number of lines
per inch:</P>
<PRE CLASS="command">
lp -o lpi=6 filename
lpr -o lpi=8 filename
</PRE>
<P>The default lines per inch is 6.</P>
<H3><A NAME="COLUMNS">Setting the Number of Columns</A></H3>
<P>The <CODE>-o columns=value</CODE> option sets the number of
text columns:</P>
<PRE CLASS="command">
lp -o columns=2 filename
lpr -o columns=3 filename
</PRE>
<P>The default number of columns is 1.</P>
<H3><A NAME="MARGINS">Setting the Page Margins</A></H3>
<P>Normally the page margins are set to the hard limits of the
printer. Use the <CODE>-o page-left=value</CODE>, <CODE>-o
page-right=value</CODE>, <CODE>-o page-top=value</CODE>, and
<CODE>-o page-bottom=value</CODE> options to adjust the page
margins:</P>
<PRE CLASS="command">
lp -o page-left=<I>value</I> filename
lp -o page-right=<I>value</I> filename
lp -o page-top=<I>value</I> filename
lp -o page-bottom=<I>value</I> filename
lpr -o page-left=<I>value</I> -o page-right=<I>value</I> -o page-top=<I>value</I> -o page-bottom=<I>value</I> filename
</PRE>
<P>The <CODE>value</CODE> argument is the margin in points; each
point is 1/72 inch or 0.35mm.</P>
<H3><A NAME="PRETTYPRINT">Pretty Printing</A></H3>
<P>The <CODE>-o prettyprint</CODE> option puts a header at the
top of each page with the page number, job title (usually the
filename), and the date. Also, C and C++ keywords are
highlighted, and comment lines are italicized:</P>
<PRE CLASS="command">
lp -o prettyprint filename
lpr -o prettyprint filename
</PRE>
</BODY>
</HTML>
|