<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>
<channel>
	<title>G-Loaded Journal &#187; CUPS</title>
	<atom:link href="http://www.g-loaded.eu/tag/cups/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.g-loaded.eu</link>
	<description>An open-source software and technology related journal</description>
	<lastBuildDate>Mon, 05 Dec 2011 19:55:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
		<item>
		<title>Using a CUPS printer from command line</title>
		<link>http://www.g-loaded.eu/2005/11/10/using-a-cups-printer-from-command-line/</link>
		<comments>http://www.g-loaded.eu/2005/11/10/using-a-cups-printer-from-command-line/#comments</comments>
		<pubDate>Thu, 10 Nov 2005 14:54:46 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CUPS]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Printing]]></category>
		<category><![CDATA[Shell]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2005/11/10/using-a-cups-printer-from-command-line/</guid>
		<description><![CDATA[This is a quick reference to the commands and print job options a user can use from command line in order to print documents. Although print dialogs have evolved, it's many times necessary to send a document to the printer with some extra options. For detailed explanation of each command's functionality please refer to the CUPS user documentation.]]></description>
			<content:encoded><![CDATA[<p>This is a quick reference to the commands and print job options a user can use from command line in order to print documents. Although print dialogs have evolved, it&#8217;s many times necessary to send a document to the printer with some extra options. For detailed explanation of each command&#8217;s functionality please refer to the CUPS user documentation.<br />
<span id="more-97"></span></p>
<h4>Prerequisites</h4>
<p>This document assumes that you have already set up your CUPS printer. This task is rather easy. Here is a list of software that can assist you in installing the printer in Fedora:</p>
<ul>
<li><b>CUPS Web Interface</b> &#8211; Point your web browser to http://localhost:631</li>
<li><b>printconf-gui</b> or <b>printtool</b> &#8211; Graphical programs.</li>
<li><b>printconf-tui</b> &#8211; The same programm running in text-mode.</li>
<li><b>lpadmin</b> &#8211; Shell program for non-interactive printer setup.</li>
</ul>
<h4>Print a document</h4>
<p>As a user, in order to print to the default printer, issue the command:</p>
<pre class="console"># lpr filename</pre>
<p>Print to specific printer:</p>
<pre class="console"># lpr -P printer filename</pre>
<p>Print multiple copies. For example, in order to print 4 copies:</p>
<pre class="console"># lpr -P printer -#4 filename</pre>
<h4>CUPS status information</h4>
<p>As a user, issue the lpstat command with proper options:</p>
<pre class="console"># lpstat &lt;options&gt;</pre>
<p>Options can be:</p>
<ul>
<li><b>-t</b> : show all CUPS info</li>
<li><b>-d</b> : show default printer</li>
<li><b>-p</b> : show all printers</li>
<li><b>-a</b> : show all printers that accept jobs</li>
<li><b>-o</b> : show active print jobs</li>
</ul>
<h4>Cancel a print job</h4>
<p>As a user, issue the command:</p>
<pre class="console"># lprm &lt;job-id&gt;</pre>
<p>Only the jobs that have been submitted by the same user can be canceled.</p>
<h4>Setting options for a specific print job</h4>
<p>Sometimes, the user needs specific print options. A general way to define specific options for a print job is:</p>
<pre class="console"># lpr -P printer -o option1=value -o option2=value filename</pre>
<h4>Modify the default print options</h4>
<p>A user can define his own options for all his print jobs for a specific printer. They are saved in the <b>~/.lpoptions</b> file and override the default options that have been defined by the system administrator for this specific CUPS printer.</p>
<h5>Add or modify print options</h5>
<p>A user can set his own default options for a specific CUPS printer by issuing the command:</p>
<pre class="console"># lpoptions -p printer -o option1=value -o option2=value</pre>
<h5>Remove print options</h5>
<p>Previously defined print options can be removed from <b>~/.lpoptions</b> by:</p>
<pre class="console"># lpoptions -p printer -r option1 -r option2</pre>
<h5>List a printer&#8217;s options</h5>
<p>To list print queue&#8217;s current options:</p>
<pre class="console"># lpoptions -p printer</pre>
<p>To list print queue&#8217;s current options:</p>
<pre class="console"># lpoptions -p printer -l</pre>
<h4>Create sets of options &#8211; Printer Instances</h4>
<p>A very useful CUPS feature is that sets of options can be defined. These can be system-wide if they are set by root, or user specific if they are set by a user. Printer instances are extra options for a specific printer that are saved as an extra printer in the form <b>printer/set</b>. This virtual printer&#8217;s settings override the default options.</p>
<p>To create a printer instance, as a user issue the command:</p>
<pre class="console"># lpoptions -p printer/set1 -o option1=value -o option2=value</pre>
<p>To delete a printer instance issue the command:</p>
<pre class="console"># lpoptions -x printer/set1</pre>
<p>The printer instance is listed as a printer in <b>lpstat</b>.<br />
The user can send a document to the printer instance:</p>
<pre class="console"># lpr -P printer/set1 filename</pre>
<h4>Appendix I &#8211; Common print options</h4>
<p>Some common print options are listed below. If an option accepts a value, then it is listed in the form option=value:</p>
<ul>
<li><b>landscape</b> &#8211; for landscape printing</li>
<li><b>media=A4</b> &#8211; check your ppd file for possible media values</li>
<li><b>Collate=true | false</b> &#8211; useful when printing multiple copies</li>
<li><b>sides=two-sided-short-edge</b> &#8211; used for landscape prints [the default is sides=one-sided]</li>
<li><b>sides=two-sided-long-edge</b> &#8211; used for portrait prints [the default is sides=one-sided]</li>
<li><b>page-ranges=1-4,7,9-12</b> &#8211; print specific pages or page ranges</li>
<li><b>page-set=odd | even</b> &#8211; print only odd or even pages</li>
<li><b>outputorder=normal | reverse</b> &#8211; the pages are printed from first to last or the other way around</li>
<li><b>cpi=10</b> &#8211; characters per inch</li>
<li><b>lpi=6</b> &#8211; lines per inch</li>
<li><b>columns=2</b> &#8211; format the text in two or more columns</li>
<li><b>page-left=value</b> &#8211; specify the left margin in points [1pt = 1/72inch]</li>
<li><b>page-right=value</b> &#8211; specify the right margin in points [1pt = 1/72inch]</li>
<li><b>page-top=value</b> &#8211; specify the top margin in points [1pt = 1/72inch]</li>
<li><b>page-bottom=value</b> &#8211; specify the bottom margin in points [1pt = 1/72inch]</li>
<li><b>job-sheets=none</b> &#8211; front and back cover pages</li>
<li><b>job-sheets=standard</b></li>
<li><b>job-sheets=classified,classified</b></li>
</ul>
<h4>Further Reading</h4>
<p>Read the full CUPS user manual at <a href="http://www.cups.org/doc-1.1/sum.html">http://www.cups.org/doc-1.1/sum.html</a></p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2005/11/10/using-a-cups-printer-from-command-line/">Using a CUPS printer from command line</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2005/11/10/print-to-cups-printer-instances/" rel="bookmark">Print to CUPS printer instances</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/06/manage-users-from-the-command-line/" rel="bookmark">User management from the command line</a></li>
<li><a href="http://www.g-loaded.eu/2006/12/03/pdf2email-cups-backend/" rel="bookmark">pdf2email CUPS Backend</a></li>
<li><a href="http://www.g-loaded.eu/2007/03/05/print-a-man-page/" rel="bookmark">Print a Man Page</a></li>
<li><a href="http://www.g-loaded.eu/2008/12/08/access-gvfs-mounts-from-the-command-line/" rel="bookmark">Access gvfs mounts from the command line</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2005/11/10/using-a-cups-printer-from-command-line/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Print to CUPS printer instances</title>
		<link>http://www.g-loaded.eu/2005/11/10/print-to-cups-printer-instances/</link>
		<comments>http://www.g-loaded.eu/2005/11/10/print-to-cups-printer-instances/#comments</comments>
		<pubDate>Thu, 10 Nov 2005 10:47:01 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CUPS]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Printing]]></category>
		<category><![CDATA[Scripts]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2005/11/10/print-to-cups-printer-instances/</guid>
		<description><![CDATA[This Nautilus script was written because gnome-print does not list the user-defined or system-wide CUPS printer instances in the printers list. &#34;Printer instances&#34; are just sets of settings, so that a user does not have to type them for every print. Check the CUPS documentation for more info. So, in order to use your defined [...]]]></description>
			<content:encoded><![CDATA[<p>This Nautilus script was written because gnome-print does not list the user-defined or system-wide CUPS printer instances in the printers list. &quot;<strong>Printer instances</strong>&quot; are just sets of settings, so that a user does not have to type them for every print. Check the <a href="http://www.cups.org/doc-1.1/sum.html">CUPS documentation</a> for more info. So, in order to use your defined printer instance, just print your document <strong>to a file</strong> from within the application. Then run the script on the postscript file. A printer selection dialog is displayed. This is where all printer instances are listed properly. After that, you are prompted to give a page range and you are done.<br />
<span id="more-88"></span><br />
<strong>Installation</strong>: put it in <code>~/.gnome2/nautilus-scripts/</code> directory and enable the executable attribute.<br />
<strong>Usage</strong>:</p>
<ol>
<li>Print your document to a postscript file using the normal gnome-print dialog from within the application</li>
<li>Select the postscript file and run the script on it from the right-click menu</li>
<li>Select your printer instance and page range (leave blank for all pages)</li>
</ol>
<p><strong>Version</strong>: 0.2<br />
<strong>Requires</strong>: Zenity</p>
<p>Download the script from the link below:<br />
<a href="http://www.g-loaded.eu/packages/bash/ps_print_gui.tar.gz">ps_print_gui.tar.gz</a></p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2005/11/10/print-to-cups-printer-instances/">Print to CUPS printer instances</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/03/05/print-a-man-page/" rel="bookmark">Print a Man Page</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/using-a-cups-printer-from-command-line/" rel="bookmark">Using a CUPS printer from command line</a></li>
<li><a href="http://www.g-loaded.eu/2006/12/03/pdf2email-cups-backend/" rel="bookmark">pdf2email CUPS Backend</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/search-for-viruses-from-nautilus/" rel="bookmark">Search for viruses from Nautilus</a></li>
<li><a href="http://www.g-loaded.eu/2005/11/10/mass-download/" rel="bookmark">Mass download</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2005/11/10/print-to-cups-printer-instances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
	</channel>
</rss>

