Repository URL to install this package:
|
Version:
2.58-1 ▾
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META NAME="author" CONTENT="f z">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
<LINK REL="Start" HREF="index.html">
<LINK REL="Contents" HREF="index.html">
<LINK REL="Prev" HREF="13-1.html">
<LINK REL="Next" HREF="14-.html">
<STYLE TYPE="text/css"><!--
BODY { font-family: sans-serif ; font-size: 10pt }
H1 { font-family: sans-serif ; font-size: 14pt }
H2 { font-family: sans-serif ; font-size: 13pt }
H3 { font-family: sans-serif ; font-size: 12pt }
H4 { font-family: sans-serif ; font-size: 12pt }
H5 { font-family: sans-serif ; font-size: 12pt }
H6 { font-family: sans-serif ; font-size: 12pt }
SUB { font-size: smaller }
SUP { font-size: smaller }
PRE { font-family: monospace }
--></STYLE>
</HEAD>
<BODY>
<A HREF="index.html">Contents</A>
<A HREF="13-1.html">Previous</A>
<A HREF="14-.html">Next</A>
<HR NOSHADE>
<H2 class="western"><A name="__RefHeading___Toc15529_1469257139"></A>
13.2 Printing from command line</H2>
<P class="western">From command line (= Terminal, Console or Shell) you
can print files using the "lp" command:</P>
<P class="western" style="margin-bottom: 0cm">
</P>
<PRE class="western">lp -d <printername> <filename></PRE>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">Depending on the Linux version also the command "lpr"
may be used:</P>
<PRE class="western">lpr -P <printername> <filename></PRE>
<P class="western" style="margin-bottom: 0cm"></P>
<P class="western">
<!--span lang="en-US"-->
Instead of <CODE>
<!--span lang="en-US"-->
<printername></CODE>
<!--span lang="en-US"-->
enter the short name of the printer configuration, as is shown in the
TurboPrint control center. The default short name for the first
TurboPrint printer is "<CODE>
<!--span lang="en-US"-->
tp0</CODE>
<!--span lang="en-US"-->
".</P>
<P class="western">
<!--span lang="en-US"-->
If you want to print a postscript file named "test.ps" to the printer "<KBD>
<!--span lang="en-US"-->
tp0</KBD>
<!--span lang="en-US"-->
", enter</P>
<P class="western" style="margin-bottom: 0cm">
</P>
<PRE class="western">lp -d tp0 test.ps</PRE>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">Another way is to use lp is to put it at the end of a
"pipe" - the output of another command is used as input from lp. This
is useful if a file is formatted or converted first before it is sent
to the printer.</P>
<P class="western">Example:</P>
<PRE class="western">a2ps --output=- textfile.txt | lp -d tp0</PRE>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">An ASCII file is converted to a postscript file using
the a2ps command. The output is printed by lpr.</P>
<P class="western">For more information on lpr see its man page, which
you can view using</P>
<P class="western"><CODE>
<!--span lang="en-US"-->
man lpr</CODE>
<!--span lang="en-US"-->
</P>
<P class="western">
</P>
<H5 class="western">Specifying print options</H5>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">Print options can be added to the „lp“ command</P>
<PRE class="western">lp -d <printername> -o <option>=<value></PRE>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">e.g.</P>
<PRE class="western">lp -d tp0 -o Resolution=600x600dpi <filename></PRE>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">There are standard options that can be used for all
printers and printer specific options.</P>
<P class="western">Some standard options are:</P>
<P class="aufzählung-1-fortsetzung-western"><B>landscape</B> print
in landscape format (page rotated by 90 degrees)</P>
<P class="aufzählung-1-fortsetzung-western"><B>
sides=two-sided-long-edge</B>
<!--span style="font-weight: normal"-->
duplex printing</P>
<P class="aufzählung-1-fortsetzung-western" style="margin-left: 5.15cm; text-indent: -4.52cm">
<B> sides=two-sided-short-edge</B> duplex (pages bound on short edge)</P>
<P class="aufzählung-1-fortsetzung-western"><B>number-up=2</B>
print 2 (4,16) pages on one sheet</P>
<P class="aufzählung-1-fortsetzung-western">
</P>
<P class="western">Further options can be found on the CUPS HTML online
help (see link below).</P>
<P class="western">The following command lists all options that are
available for a printer</P>
<PRE class="western">lpoptions -p <printername> -l</PRE>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">an.</P>
<H5 class="western">Formatting ASCII documents</H5>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">To print ASCII text files in a certain layout, you
can call a2ps or enscript directly. Here are some examples:</P>
<PRE class="western">a2ps --portrait --borders=0 --columns=1 --no-header --printer=tp0 myfile.txt
<!--span lang="en-US"-->
enscript --portrait --columns=1 --no-header --printer=tp0 myfile.txt</PRE>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">prints just the text - no borders, one column, no
headers</P>
<PRE class="western">a2ps --landscape --borders=1 --columns=2 --printer=tp0 myfile.txt
<!--span lang="en-US"-->
enscript --landscape --borders --columns=2 --printer=tp0 myfile.txt</PRE>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">prints the text in landscape orientation with
borders, two columns per page with headers (filename, page numbers).</P>
<P class="western">
<!--span lang="en-US"-->
For more information on a2ps and enscript see the man pages <CODE>
<!--span lang="en-US"-->
(man a2ps, man enscript)</CODE>
<!--span lang="en-US"-->
.</P>
<P class="western">
</P>
<H5 class="western">Printing Images</H5>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">Images e.g. in JPG format can be printed directly
from command line. Positioning and scaling is done by the CUPS printing
system. By default images are rotated if in landscape format and are
printed in original size (i.e. the size stored in the image file). If
image size exceeds page size several pages are printed.</P>
<P class="western">Image size (in percent of page size) can be specified
from command line, e.g.</P>
<PRE class="western">lp -d tp0 -o scaling=50 filename.jpg</PRE>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">Further options can be found in the CUPS HTML online
help - see link below.</P>
<P class="western">
<!--span lang="en-US"-->
If you want to position images exactly or if you want to print several
images on one page you can use the application "
<!--span lang="en-US"-->
Libre
<!--span lang="en-US"-->
Office Draw" - see also section "<A class="western" href="13-1.html#13.1.3.OpenOffice|outline">
13.1.3</A> <A class="western" href="13-1.html#13.1.3.OpenOffice|outline">
<!--span lang="en-US"-->
LibreOffice /</A>
<!--span lang="en-US"-->
<A class="western" href="13-1.html#13.1.3.OpenOffice|outline">
OpenOffice</A>" in this chapter.</P>
<P class="western">
</P>
<H5 class="western">Which file types can be printed?</H5>
<P class="western">Many common file types like postscript documents,
plain ASCII files or JPG images can be printed directly from command
line. If a file format is not supported directly (like some image
formats) it must be converted first.</P>
<P class="western">Responsible for correctly discerning the file type is
the CUPS printing system - see HTML online help in the CUPS web
frontend</P>
<P class="western"><A class="western" href="http://localhost:631/">
<!--span lang="en-US"-->
http://localhost:631/</A></P>
<P class="western">
</P>
<HR NOSHADE>
<A HREF="index.html">Contents</A>
<A HREF="13-1.html">Previous</A>
<A HREF="14-.html">Next</A>
</BODY>
</HTML>