Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
turboprint / usr / share / doc / turboprint / html / 13-2.html
Size: Mime:
<!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 &quot;lp&quot; command:</P>
<P class="western" style="margin-bottom: 0cm">
</P>
<PRE class="western">lp -d &lt;printername&gt; &lt;filename&gt;</PRE>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">Depending on the Linux version also the command &quot;lpr&quot;
 may be used:</P>
<PRE class="western">lpr -P &lt;printername&gt; &lt;filename&gt;</PRE>
<P class="western" style="margin-bottom: 0cm"></P>
<P class="western">
<!--span lang=&quot;en-US&quot;-->
Instead of <CODE>
<!--span lang=&quot;en-US&quot;-->
&lt;printername&gt;</CODE>
<!--span lang=&quot;en-US&quot;-->
 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 &quot;<CODE>
<!--span lang=&quot;en-US&quot;-->
tp0</CODE>
<!--span lang=&quot;en-US&quot;-->
&quot;.</P>
<P class="western">
<!--span lang=&quot;en-US&quot;-->
If you want to print a postscript file named &quot;test.ps&quot; to the printer &quot;<KBD>

<!--span lang=&quot;en-US&quot;-->
tp0</KBD>
<!--span lang=&quot;en-US&quot;-->
&quot;, 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
 &quot;pipe&quot; - 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=&quot;en-US&quot;-->
man lpr</CODE>
<!--span lang=&quot;en-US&quot;-->
</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 &bdquo;lp&ldquo; command</P>
<PRE class="western">lp -d &lt;printername&gt; -o &lt;option&gt;=&lt;value&gt;</PRE>
<P class="western" style="margin-bottom: 0cm">
</P>
<P class="western">e.g.</P>
<PRE class="western">lp -d tp0 -o Resolution=600x600dpi &lt;filename&gt;</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&auml;hlung-1-fortsetzung-western"><B>landscape</B> print
 in landscape format (page rotated by 90 degrees)</P>
<P class="aufz&auml;hlung-1-fortsetzung-western"><B>
sides=two-sided-long-edge</B>
<!--span style=&quot;font-weight: normal&quot;-->
 duplex printing</P>
<P class="aufz&auml;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&auml;hlung-1-fortsetzung-western"><B>number-up=2</B>
 print 2 (4,16) pages on one sheet</P>
<P class="aufz&auml;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 &lt;printername&gt; -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=&quot;en-US&quot;-->
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=&quot;en-US&quot;-->
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=&quot;en-US&quot;-->
For more information on a2ps and enscript see the man pages <CODE>
<!--span lang=&quot;en-US&quot;-->
(man a2ps, man enscript)</CODE>
<!--span lang=&quot;en-US&quot;-->
.</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=&quot;en-US&quot;-->
If you want to position images exactly or if you want to print several
 images on one page you can use the application &quot;
<!--span lang=&quot;en-US&quot;-->
Libre
<!--span lang=&quot;en-US&quot;-->
Office Draw&quot; - see also section &quot;<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=&quot;en-US&quot;-->
LibreOffice /</A>
<!--span lang=&quot;en-US&quot;-->
 <A class="western" href="13-1.html#13.1.3.OpenOffice|outline">
OpenOffice</A>&quot; 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=&quot;en-US&quot;-->
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>