<?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; Printing</title>
	<atom:link href="http://www.g-loaded.eu/tag/printing/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>How to create a single file of Sphinx based documentation</title>
		<link>http://www.g-loaded.eu/2010/10/29/sphinx-documentation-single-file/</link>
		<comments>http://www.g-loaded.eu/2010/10/29/sphinx-documentation-single-file/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 17:17:13 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Printing]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/?p=2073</guid>
		<description><![CDATA[It has become common nowadays that Python projects provide their documentation in &#8220;source form&#8220;. The documentation is split into multiple files, written in restructured text, and is shipped together with some other configuration and media files for Sphinx. The user is meant to use the provided Makefile to export the documentation in various formats. This [...]]]></description>
			<content:encoded><![CDATA[<p>It has become common nowadays that Python projects provide their documentation in &#8220;<em>source form</em>&#8220;. The documentation is split into multiple files, written in <a href="http://docutils.sourceforge.net/rst.html">restructured text</a>, and is shipped together with some other configuration and media files for <a href="http://sphinx.pocoo.org">Sphinx</a>. The user is meant to use the provided <code>Makefile</code> to export the documentation in various formats. This is good and useful. Sphinx generates some nice and very readable HTML files. The only problem I encountered today was that the provided <em>Makefile</em> or <em>make.bat</em> batch script (for Windows) cannot be used to generate a <strong>single file</strong> containing the whole documentation of the project. At first, it seemed that in order to print the whole documentation I should either:<br />
<span id="more-2073"></span></p>
<ul>
<li>export the documentation into multiple HTML files using <strong>make html</strong> and then send the relevant html files one-by-one to the printer, which is insanely inconvenient, or</li>
<li>export the documentation to LaTeX format and then use a <code>tex-to-pdf</code> converter in order to merge the documentation files into a single file, which I would finally send to the printer. It should be noted that in this case, the tex-to-pdf converter had some other dependencies which summed up to 130+MB. Compressed. That&#8217;s insanely too much for converting the documentation to single-file form!!!</li>
</ul>
<p>So, I ended up <a href="http://www.g-loaded.eu/2005/10/03/search-a-string-in-multiple-files/">using grep</a> to scan the sphinx source code for expressions like <em>single</em>, <em>single file</em> etc. I soon hit <em>singlehtml</em>! Fortunately, there is a builder, named <strong>singlehtml</strong>, that produces a single HTML document for documentation that is split into multiple files. Hooray!!</p>
<p>I used the <strong>sphinx-build</strong> utility directly to generate a single HTML document containing the entire documentation. After changing to the documentation&#8217;s root directory, I issued the command:</p>
<pre class="console">
sphinx-build -b singlehtml . zzz
</pre>
<p>I finally had a single HTML file at <code>zzz/index.html</code>, which I sent to the printer and got some nice documentation in-print.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2010/10/29/sphinx-documentation-single-file/">How to create a single file of Sphinx based documentation</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/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/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/2007/03/05/print-a-man-page/" rel="bookmark">Print a Man Page</a></li>
<li><a href="http://www.g-loaded.eu/2009/01/22/effective-data-wiping-with-a-single-complete-overwrite/" rel="bookmark">Effective data wiping with a single complete overwrite</a></li>
<li><a href="http://www.g-loaded.eu/2005/10/01/another-way-to-create-a-text-file/" rel="bookmark">Another way to create a text file</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2010/10/29/sphinx-documentation-single-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>Print a Man Page</title>
		<link>http://www.g-loaded.eu/2007/03/05/print-a-man-page/</link>
		<comments>http://www.g-loaded.eu/2007/03/05/print-a-man-page/#comments</comments>
		<pubDate>Mon, 05 Mar 2007 15:22:36 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Printing]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2007/03/05/print-a-man-page/</guid>
		<description><![CDATA[Reading a man page using a terminal application is easy, but I doubt if it would ever win a convenience award. Sometimes, it is necessary to print the man page. I can recommend two ways of doing this. First, using the -t switch, when launching the man command from a terminal, causes the man page [...]]]></description>
			<content:encoded><![CDATA[<p>Reading a man page using a terminal application is easy, but I doubt if it would ever win a convenience award. Sometimes, it is necessary to print the man page. I can recommend two ways of doing this.<br />
<span id="more-367"></span><br />
First, using the <strong>-t</strong> switch, when launching the <strong>man</strong> command from a terminal, causes the man page to be formatted in <strong>Postscript</strong>. Technically, it uses <code>groff</code> to perform the conversion. More information about this can be found within the man command&#8217;s manual page (<code>man 1 man</code>).</p>
<p>The Postscript output can be piped to <strong>lpr</strong> for printing in a CUPS printer. The following example prints the <code>iptables</code> manual page to the <em>HP690C</em> printer:</p>
<pre class="console">$ man -t iptables | lpr -P HP690C</pre>
<p>Alternatively, the output can be saved to a postscript file:</p>
<pre class="console">$ man -t iptables > iptables.ps</pre>
<p>More on using a CUPS printer from the CLI can be found <a href="http://www.g-loaded.eu/2005/11/10/using-a-cups-printer-from-command-line/">here</a>.</p>
<p>Those who have the <a href="http://live.gnome.org/Yelp">Yelp</a> GNOME application installed, can take advantage of its internal man page parser and HTML converter. For example, in order to display the iptables man page in Yelp, launch it like the following:</p>
<pre class="console">$ yelp man:iptables</pre>
<p>From there, you can use the GNOME print dialog to print the iptables manual.</p>
<p>I tend to prefer the quality of the man page when it has been printed through Yelp.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2007/03/05/print-a-man-page/">Print a Man Page</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/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/05/04/write-a-man-page/" rel="bookmark">Write A Man Page</a></li>
<li><a href="http://www.g-loaded.eu/2006/09/23/use-python-to-get-the-web-page-data-in-epiphany/" rel="bookmark">Use Python to get the web page data in Epiphany</a></li>
<li><a href="http://www.g-loaded.eu/2006/12/03/pdf2email-cups-backend/" rel="bookmark">pdf2email CUPS Backend</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2007/03/05/print-a-man-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<item>
		<title>pdf2email CUPS Backend</title>
		<link>http://www.g-loaded.eu/2006/12/03/pdf2email-cups-backend/</link>
		<comments>http://www.g-loaded.eu/2006/12/03/pdf2email-cups-backend/#comments</comments>
		<pubDate>Sun, 03 Dec 2006 14:22:09 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Printing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2006/12/03/pdf2email-cups-backend/</guid>
		<description><![CDATA[pdf2email is a CUPS backend that uses GhostScript to print a document to PDF and sends the final file to the user that requested the print via email. This software is written in Python. I had written this backend a few months ago, it has worked fine for me, so I decided to release it. Your feedback is welcome.]]></description>
			<content:encoded><![CDATA[<p><strong>pdf2email</strong> is a <abbr title="Common UNIX Printing System">CUPS</abbr> backend that uses GhostScript to print a document to <strong>PDF</strong> and sends the final file to the user that requested the print via email. This software is written in Python. I had written this backend a few months ago, it has worked fine for me, so I decided to release it. Your feedback is welcome.<br />
<span id="more-314"></span></p>
<h4>Requirements</h4>
<p>The following software is required so that this backend functions correctly:</p>
<ol>
<li>Python (<a href="http://www.python.org/">http://www.python.org</a>)</li>
<li>CUPS server (<a href="http://www.cups.org/">http://www.cups.org/</a>)</li>
<li>Ghostscript (<a href="http://www.cs.wisc.edu/~ghost/">http://www.cs.wisc.edu/~ghost/</a>)</li>
<li>a postscript printer&#8217;s PPD file. (see <a href="#installation">Installation</a> section)</li>
<li>Email server, on which usernames from the LAN workstations either match the users on the email server or proper mappings (aliases) have been set.</li>
</ol>
<p><a id="installation"></a></p>
<h4>Installation</h4>
<p>Put the &#8220;<code>pdf2email</code>&#8221; file in <code>/usr/lib/cups/backend/</code> and set the executable bit:</p>
<pre class="console">chmod +x /usr/lib/cups/backend/pdf2email</pre>
<h4>Configuration</h4>
<p>Open the script in a text editor and set a couple of settings:</p>
<p>1. Set the email server&#8217;s hostname:</p>
<pre class="codesnp">SMTP_Server = "mail.example.org"</pre>
<p>2. Set the email address of the sender as it will appear in the email:</p>
<pre class="codesnp">print_admin = "admin@example.org"</pre>
<p>3. (<em>Optional</em>) Set the path to a text file that contains PDFmarks. If you don&#8217;t know what PDFmarks are, you <strong>should</strong> leave this variable empty. (see some more info in the PDFmarks section):</p>
<pre class="codesnp">pdfmarks_file = ""</pre>
<h4>Configure a CUPS Printer</h4>
<p>This section describes in brief all the required actions in order to add a printer that uses this backend to CUPS.</p>
<ul>
<li>Decide the printer&#8217;s name, eg &#8220;TestPDFprinter&#8221;.</li>
<li>Decide the directory, where the PDF files are saved temporarily. This directory must be writable by the users. Usually, <code>/tmp</code> is perfect for this. Note, that no PDF files are left in this directory. This piece of information is used in the <strong>Device URI</strong> of your CUPS printer. For example, provided that the <code>/tmp</code> directory will be used, the Device URI would be: <code>pdf2email:/tmp</code></li>
<li>Get a postscript printer&#8217;s PPD file. You can find such files at:
<ul>
<li>Your printer <strong>manufacturer</strong>&#8216;s web site.</li>
<li><a href="http://www.linuxprinting.org/show_driver.cgi?driver=Postscript">Linux Printing</a></li>
<li><a href="http://www.adobe.com/support/downloads/">Adobe&#8217;s download center</a></li>
</ul>
</li>
</ul>
<blockquote><p><strong>WARNING</strong>: It is your exclusive responsibility to examine the printer driver&#8217;s license prior to using the PPD file. <strong>NO PPD FILES ARE SHIPPED WITH THE pdf2email BACKEND</strong>.</p></blockquote>
<p>Finally, add a new printer that uses this backend, either by using lpadmin from the command line or by using the web-based administration interface of CUPS or by using any other CUPS Server management software.</p>
<h5>Using lpadmin from the shell</h5>
<p>As root issue the following command:</p>
<pre class="console">lpadmin -p TestPDFprinter -E -v pdf2email:/tmp -P /path/to/myprinter.ppd</pre>
<h5>Using CUPS web-based interface or other software</h5>
<p>Use the provided &#8220;<strong>Add Printer</strong>&#8221; facility. Some notes that might be useful:</p>
<ul>
<li>In the device dropdown box, select the following:<br /> <code>Direct PDF Printing/Delivery to user email</code></li>
<li>In the device URI box use the writable directory, eg:<br /> <code>pdf2email:/tmp</code></li>
<li>If asked about the type of the print queue, use &#8220;<code>RAW</code>&#8220;.</li>
</ul>
<h4>USAGE</h4>
<p>Make this printer available to the LAN through the IPP, SAMBA or any other protocol and add it to your printer list in your client machines. Whatever you send to that printer will be converted to a PDF document and will be emailed to your user&#8217;s email address.</p>
<h4>Trouble?</h4>
<p>If any error occurs during the PDF creation process, there will be a failure notice in your inbox and a message in syslog (<code>/var/log/messages</code>).</p>
<p>In case you receive no email after requesting a print, check syslog for any error messages. If there aren&#8217;t any, the check CUPS error log.</p>
<p>Finally, note that if you use a security layer like SELinux, then you might need to further adjust it so it lets 3rd party CUPS backends to function. This is beyond the scope of this document.</p>
<h4>PDFmarks</h4>
<p>If you do not know what pdfmarks are, please do a web search about them. This backend can include PDFmarks in the final PDF document. Do not expect anything spectacular, as this script cannot process the document for bookmarks, links etc. What it can do is to add pre-defined pdfmarks to all PDF documents.</p>
<p>For example, if, for example,  you want to fill some of the document properties, save the following in a file:</p>
<pre class="codesnp">
[/Title ()
/Author ()
/Subject (blah blah)
/Keywords (keyword1, keyword2, blah)
/DOCINFO pdfmark
</pre>
<p>By default the author&#8217;s property is filled with the username that requested the print.</p>
<p>Finally, add the path to the pdfmarks file in the configuration section of the backend, as described in the configuration section:</p>
<pre class="codesnp">pdfmarks_file = "/path/to/pdfmarks.file"</pre>
<p>This feature has not been tested thoroughly.</p>
<h4>License</h4>
<p>This project is released under the terms of the <a href="http://www.g-loaded.eu/licenses/GPL">GNU General Public License</a>.</p>
<h4>Download</h4>
<p>All versions of the software, including the latest stable release, are available from the development web site&#8217;s <a href="http://www.codetrax.org/projects/pdf2email/files">download area</a>.</p>
<h4>Donate</h4>
<p>This software is released as <strong>free software</strong>. Nevertheless, its development requires time and effort. A small donation, as a sign of appreciation of the effort, is welcome. Please, use the following button to visit the <em>Donations</em> page. Thank you.</p>
<p><a href="http://www.g-loaded.eu/about/donate" title="Donate"><img src="/images/donations_button.png" alt="Donations Button" /></a></p>
<h4>Support</h4>
<p>This software is released as <em>free software</em> without any warranties or official support. You can still get first class <strong>support</strong> from the <a href="http://www.codetrax.org/projects/pdf2email/boards">community of users</a>.</p>
<h4>Bugs and Feature Requests</h4>
<p>Found a bug? Want to suggest a new feature for the upcoming release? Feel free to file your requests in the <a href="http://www.codetrax.org/projects/pdf2email/issues">issue database</a> on the <a href="http://www.codetrax.org/projects/pdf2email">development website</a>.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2006/12/03/pdf2email-cups-backend/">pdf2email CUPS Backend</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/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/2007/03/05/print-a-man-page/" rel="bookmark">Print a Man Page</a></li>
<li><a href="http://www.g-loaded.eu/2008/01/24/viceo-backend-for-sane-with-libusb-support/" rel="bookmark">Viceo Backend for SANE with libusb support</a></li>
<li><a href="http://www.g-loaded.eu/2010/10/29/sphinx-documentation-single-file/" rel="bookmark">How to create a single file of Sphinx based documentation</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2006/12/03/pdf2email-cups-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
		<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>

