<?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/"
	>

<channel>
	<title>PRINT HEAD</title>
	<atom:link href="http://cyberelk.net/tim/feed/" rel="self" type="application/rss+xml" />
	<link>http://cyberelk.net/tim</link>
	<description></description>
	<lastBuildDate>Mon, 06 Feb 2012 11:16:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CUPS 1.6 changes ahead</title>
		<link>http://cyberelk.net/tim/2012/02/06/cups-1-6-changes-ahead/</link>
		<comments>http://cyberelk.net/tim/2012/02/06/cups-1-6-changes-ahead/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 11:16:36 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cups]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=940</guid>
		<description><![CDATA[As I mentioned elsewhere, there are some changes ahead in CUPS 1.6. These changes are not imminent but give an indication of the direction the CUPS project is heading. Back in 2007 CUPS became an Apple project.  Now the parts that are not relevant on Mac OS are being dropped, with some of the Linux-relevant [...]]]></description>
			<content:encoded><![CDATA[<p>As I <a href="http://lists.fedoraproject.org/pipermail/devel/2012-January/161306.html" target="_blank">mentioned elsewhere</a>, there are some changes ahead in CUPS 1.6. These changes are not imminent but give an indication of the direction the CUPS project is heading.</p>
<p>Back in 2007 CUPS became an Apple project.  Now the parts that are not relevant on Mac OS are being dropped, with some of the Linux-relevant parts being gathered together in a separate project, cups-filters.</p>
<p><span id="more-940"></span></p>
<p>The main part that is being dropped completely is <strong>CUPS Browsing</strong>. This is currently the primary mechanism for CUPS-to-CUPS printer queue discovery on Linux. It works by having each CUPS server periodically broadcast UDP packets on port 631 announcing its available queues, and listening for broadcasts from other CUPS servers.</p>
<p>This discovery method is being dropped because DNS-SD is preferred upstream. Support for it has been upstream in CUPS for a while, and it is what CUPS uses on Mac OS X, but it uses Apple&#8217;s libdns_sd library and not Avahi. I have added support for this in Fedora, and the patch is <a href="http://cups.org/str.php?L3066" target="_blank">submitted upstream</a>.</p>
<p>So in CUPS 1.6, automatic CUPS queue discovery <strong>will require Avahi to be running</strong> on both the server (i.e. the system hosting the CUPS queue) and the clients (i.e. the systems wanting to print to it).</p>
<p>Of course, you will be able to run CUPS without having Avahi running &#8212; but you won&#8217;t have automatic CUPS queue discovery in that case.  Clients will have to have queues explicitly configured, or else use the BrowsePoll configuration setting to periodically query a particular CUPS server for its queues.</p>
<p>Several other filters will be dropped from CUPS in 1.6, to be picked up by the <strong>new cups-filters package</strong>. Information about this package is on the <a href="http://www.linuxfoundation.org/collaborate/workgroups/openprinting" target="_blank">OpenPrinting web site</a> and a <a href="http://www.openprinting.org/download/cups-filters/" target="_blank">beta release</a> is now available.</p>
<p>This new package restores the filters that will be dropped in CUPS 1.6 and also adds new filters to support PDF as the baseline document format rather than PostScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2012/02/06/cups-1-6-changes-ahead/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CUPS disabled on upgrade to Fedora 16</title>
		<link>http://cyberelk.net/tim/2011/11/14/cups-disabled-on-upgrade-to-fedora-16/</link>
		<comments>http://cyberelk.net/tim/2011/11/14/cups-disabled-on-upgrade-to-fedora-16/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 12:23:31 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=932</guid>
		<description><![CDATA[One common bug that people are running into with Fedora 16 is that CUPS is no longer enabled after upgrade from an earlier version of Fedora (fresh installs are unaffected). This has already been reported in Bugzilla, and a test update is available. There is also an Ask Fedora answer about it.]]></description>
			<content:encoded><![CDATA[<p>One common bug that people are running into with Fedora 16 is that CUPS is no longer enabled after upgrade from an earlier version of Fedora (fresh installs are unaffected).</p>
<p>This has already been <a href="https://bugzilla.redhat.com/show_bug.cgi?id=748841" target="_blank">reported in Bugzilla</a>, and a <a href="https://admin.fedoraproject.org/updates/FEDORA-2011-15223" target="_blank">test update</a> is available.</p>
<p>There is also an <a href="http://ask.fedoraproject.org/question/253/cups-doesnt-start-after-upgrade-from-f15-to-f16?answer=445" target="_blank">Ask Fedora answer</a> about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2011/11/14/cups-disabled-on-upgrade-to-fedora-16/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Printing Test Day</title>
		<link>http://cyberelk.net/tim/2011/10/05/printing-test-day-2/</link>
		<comments>http://cyberelk.net/tim/2011/10/05/printing-test-day-2/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 09:51:18 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=929</guid>
		<description><![CDATA[It&#8217;s that time again.  Fedora 16&#8242;s Printing Test Day is tomorrow, Thursday October 6th.  Come along and help make printing work better on Fedora! The Test Day page has instructions on what you need and how to test.]]></description>
			<content:encoded><![CDATA[<p><a href="http://cyberelk.net/tim/wp-content/uploads/2011/03/test-day-100.png"><img class="alignright size-full wp-image-892" title="test-day-100" src="http://cyberelk.net/tim/wp-content/uploads/2011/03/test-day-100.png" alt="" width="100" height="100" /></a>It&#8217;s that time again.  Fedora 16&#8242;s Printing Test Day is tomorrow, Thursday October 6th.  Come along and help make printing work better on Fedora!</p>
<p>The <a href="https://fedoraproject.org/wiki/Test_Day:2011-10-06_Printing">Test Day page</a> has instructions on what you need and how to test.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2011/10/05/printing-test-day-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>D-Bus and Python: asynchronous method implementation</title>
		<link>http://cyberelk.net/tim/2011/08/16/d-bus-and-python-asynchronous-method-implementation/</link>
		<comments>http://cyberelk.net/tim/2011/08/16/d-bus-and-python-asynchronous-method-implementation/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 16:16:11 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=900</guid>
		<description><![CDATA[This is a quick demonstration of how to implement a D-Bus method in Python using asynchronous callbacks. I recently added support in system-config-printer for determining the best driver to use for a particular printer.  This is an expensive operation, largely because of the time it takes to get a list of available drivers from CUPS, [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick demonstration of how to implement a D-Bus method in Python using asynchronous callbacks.</p>
<p>I recently <a href="http://cyberelk.net/tim/2011/07/22/more-d-bus-goodness-in-system-config-printer/">added support</a> in system-config-printer for determining the best driver to use for a particular printer.  This is an expensive operation, largely because of the time it takes to get a list of available drivers from CUPS, and the Python program providing the D-Bus service also provides other services.  I wanted the program to be able to deal with other callers while the CUPS operation was in progress.  Here&#8217;s how that was done.</p>
<p><span id="more-900"></span></p>
<p>Firstly, I already had a class for asynchronous communication with CUPS.  When using PolicyKit to talk to CUPS, the calls use D-Bus which provides an asynchronous API for method calls anyway.  For calls not provided that way the fallback is to queue requests for a worker thread to deal with.</p>
<p>Asynchronous D-Bus calls are made in Python by supplying &#8220;reply_handler&#8221; and &#8220;error_handler&#8221; named options in the method call, like this:</p>
<pre>self._cupsconn.getPPDs2 (reply_handler=self._cups_getppds_reply,
                         error_handler=self._cups_error)</pre>
<p>That call returns right away, but the <tt>getPPDs2</tt> operation continues in the background.  When it is done, my reply_handler function is called.  Alternatively, if there is an error, the error_handler function is called.  One or the other will be called, at which point the operation is finished with.</p>
<p>So far so good from the client side, but the question is how to implement a D-Bus <em>service</em> in an asynchronous manner.  Here is a reminder of what a synchronous D-Bus service implementation looks like.</p>
<pre>#!/usr/bin/python
import gobject
import dbus.service
import time

BUS='com.example.Timer'
PATH='/com/example/Timer'
IFACE='com.example.Timer'
START_TIME=time.time ()

class Timer(dbus.service.Object):
    def __init__ (self):
        self.bus = dbus.SessionBus ()
        bus_name = dbus.service.BusName (BUS, bus=self.bus)
        dbus.service.Object.__init__ (self, bus_name, PATH)

    @dbus.service.method(dbus_interface=IFACE,
                         in_signature='i',
                         out_signature='i')
    def Delay (self, seconds):
        print "Sleeping for %ds" % seconds
        time.sleep (seconds)
        return seconds

def heartbeat():
    print "Still alive at", time.time () - START_TIME
    return True

from dbus.glib import DBusGMainLoop
DBusGMainLoop (set_as_default=True)
loop = gobject.MainLoop ()
# Start the heartbeat
handle = gobject.timeout_add_seconds (1, heartbeat)
# Start the D-Bus service
timer = Timer ()
loop.run ()</pre>
<p>The Timer class is the D-Bus service.  It has a single method, Delay, which delays for a number of seconds and returns that same number.  The program sets a repeating 1-second timer to print &#8220;Still alive&#8221;, and the D-Bus calls into the Timer service are handled by the D-Bus main loop.</p>
<p>How does this program behave?  Here is its output.  While it was running I used <a href="http://live.gnome.org/DFeet/">D-Feet</a> to call Delay(3).</p>
<pre>Still alive at 1.02512407303
Still alive at 2.0262401104
Still alive at 3.02633500099
Still alive at 4.02575397491
Sleeping for 3s
Still alive at 7.0756611824
Still alive at 8.02573609352
Still alive at 9.02583909035
Still alive at 10.0259339809
^CTraceback (most recent call last):
  File "/tmp/demo.py", line 36, in &lt;module&gt;
    loop.run ()
KeyboardInterrupt</pre>
<p>As you can see, while it was handling the call to the Delay method it could not do anything else.  Here is a new version of the Delay function, this time implemented using asynchronous callbacks.</p>
<pre>    @dbus.service.method(dbus_interface=IFACE,
                         in_signature='i',
                         out_signature='i',
                         async_callbacks=('reply_handler',
                                          'error_handler'))
    def Delay (self, seconds, reply_handler, error_handler):
        print "Sleeping for %ds" % seconds
        gobject.timeout_add_seconds (seconds,
                                     lambda: reply_handler (seconds))</pre>
<p>You&#8217;ll notice that the D-Bus function decorator now contains an async_callbacks keyword.  This keyword declares the method keywords that the function uses for reply and error handlers.  Here, I&#8217;ve stuck with the usual &#8220;reply_handler&#8221; and &#8220;error_handler&#8221; names, and added those same names to the definition of the Delay function on the next line.</p>
<p>This time, when the D-Bus main loop calls the Delay method it will also provide the reply and error callbacks.  When the Delay method returns, its return value is ignored.  The D-Bus call is only ended by calling one of the callbacks.  In this very simple implementation, I&#8217;ve arranged for that to happen by setting a timeout.</p>
<p>How does the program behave now?</p>
<pre>Still alive at 1.07246303558
Still alive at 2.07272696495
Still alive at 3.07237696648
Still alive at 4.07276511192
Sleeping for 3s
Still alive at 5.07263112068
Still alive at 6.07277011871
Still alive at 7.07274699211
Still alive at 8.07311701775
Still alive at 9.07332015038
Still alive at 10.0734181404
Still alive at 11.0735199451
^CTraceback (most recent call last):
  File "/tmp/demo-async.py", line 38, in &lt;module&gt;
    loop.run ()
KeyboardInterrupt</pre>
<p>Much better.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2011/08/16/d-bus-and-python-asynchronous-method-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avahi support for CUPS 1.5.0</title>
		<link>http://cyberelk.net/tim/2011/08/09/avahi-support-for-cups-1-5-0/</link>
		<comments>http://cyberelk.net/tim/2011/08/09/avahi-support-for-cups-1-5-0/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 15:06:11 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Avahi]]></category>
		<category><![CDATA[cups]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=915</guid>
		<description><![CDATA[The Avahi support for CUPS has been ported to 1.5.0 now.  I&#8217;ve updated the git repository (tracking upstream CUPS, as well as having feature branches for Avahi): git://fedorapeople.org/home/fedora/twaugh/public_html/cups-avahi.git Fedora packages for F-16 and rawhide have been built.]]></description>
			<content:encoded><![CDATA[<p>The Avahi support for CUPS has been ported to 1.5.0 now.  I&#8217;ve updated the git repository (tracking upstream CUPS, as well as having feature branches for Avahi):<br />
<tt>git://fedorapeople.org/home/fedora/twaugh/public_html/cups-avahi.git</tt></p>
<p>Fedora packages for F-16 and rawhide have been built.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2011/08/09/avahi-support-for-cups-1-5-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>More D-Bus goodness in system-config-printer</title>
		<link>http://cyberelk.net/tim/2011/07/22/more-d-bus-goodness-in-system-config-printer/</link>
		<comments>http://cyberelk.net/tim/2011/07/22/more-d-bus-goodness-in-system-config-printer/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 16:02:25 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cups]]></category>
		<category><![CDATA[printing]]></category>
		<category><![CDATA[system-config-printer]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=902</guid>
		<description><![CDATA[Previously I&#8217;ve described the D-Bus activation of dialogs in system-config-printer-1.3.  That D-Bus interface has been extended to help improve GNOME. Fedora 15 has been released for a little while now, including GNOME 3.  One of the great new features in this release of GNOME is the System Settings window.  It is easily accessed from the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cyberelk.net/tim/2011/04/13/using-system-config-printer-from-d-bus/">Previously</a> I&#8217;ve described the D-Bus activation of dialogs in system-config-printer-1.3.  That D-Bus interface has been extended to help improve GNOME.</p>
<p>Fedora 15 has been released for a little while now, including GNOME 3.  One of the great new features in this release of GNOME is the System Settings window.  It is easily accessed from the system menu in the top right corner of the desktop.</p>
<p><img class="size-full wp-image-903 alignnone" title="menu" src="http://cyberelk.net/tim/wp-content/uploads/2011/07/menu.png" alt="" width="160" height="284" /></p>
<p>This shows a System Settings window containing an overview of all the various tweakable settings for the system, including personal preferences.  They are shown as icons, such as &#8220;Keyboard&#8221;, &#8220;Background&#8221;, &#8220;Printers&#8221; etc, organised into groups: Personal, Hardware, System, and Other.  Clicking on one of them changes the window so it shows the settings relating to that topic.  So if you click on Printers, you get this:</p>
<p><a href="http://cyberelk.net/tim/wp-content/uploads/2011/07/Screenshot-Printers1.png"><img class="alignnone size-full wp-image-908" title="Screenshot-Printers" src="http://cyberelk.net/tim/wp-content/uploads/2011/07/Screenshot-Printers1.png" alt="" width="450" height="332" /></a></p>
<p>It&#8217;s great to have printer configuration in GNOME, and this interface is nice and simple.  There are a couple of things that it needs to learn to do though.</p>
<p><span id="more-902"></span></p>
<p>One of them is choosing a good driver when adding a printer.  This is something that is <a href="http://cyberelk.net/tim/2011/02/23/adding-a-printer-to-cups/">not easy</a>, and system-config-printer has a fair amount of logic to deal with it.  Now that logic is exposed via D-Bus, so the GNOME System Settings program will be able to use it in future.</p>
<pre>node "/org/fedoraproject/Config/Printing" {
  interface "org.fedoraproject.Config.Printing" {
    method "GetBestDrivers"      (
      in s device_id
      in s device_make_and_model
      in s device_uri
      out a(ss) drivers
    )
  }
}</pre>
<p>Given the IEEE 1284 Device ID of the printer, and/or a string describing the make and model, and the CUPS device URI to be used, this method returns a list of drivers that should work.  They are ordered with the &#8220;best&#8221; choice first, and with descriptions of how good a fit each driver is for this model (e.g. <tt>exact</tt>, <tt>close</tt>, etc).</p>
<p>Two other methods have been exposed using D-Bus.  The first is a method for examining a PPD and deciding whether it has unmet requirements.  Often a PPD will containing information about what commands to run to convert from various different formats into the format required for the printer.  This method parses those and returns a list of executables that are missing.</p>
<pre>node "/org/fedoraproject/Config/Printing" {
  interface "org.fedoraproject.Config.Printing" {
    method "MissingExecutables"      (
      in s ppd_filename
      out as missing_executables
    )
  }
}</pre>
<p>The final method is for grouping together CUPS device URIs that address the same physical device.  It is often the case that there is a choice of backends to use for a printer, and this method helps to sort out which devices are just different choices for the same printer.</p>
<pre>node "/org/fedoraproject/Config/Printing" {
  interface "org.fedoraproject.Config.Printing" {
    method "GroupPhysicalDevices"      (
      in a{sa{ss}} devices
      out aas grouped_devices
    )
  }
}</pre>
<p>It takes a dictionary (keyed by device URI) of IPP attribute dictionaries describing devices, and returns a list of physical devices, each one represented by a list of device URIs that refer to it.</p>
<p>These methods will be in system-config-printer 1.3.5.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2011/07/22/more-d-bus-goodness-in-system-config-printer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using system-config-printer from D-Bus</title>
		<link>http://cyberelk.net/tim/2011/04/13/using-system-config-printer-from-d-bus/</link>
		<comments>http://cyberelk.net/tim/2011/04/13/using-system-config-printer-from-d-bus/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 12:50:46 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=896</guid>
		<description><![CDATA[One of the new features in system-config-printer-1.3 is that various dialogs are can now be invoked using D-Bus.  The details of this are in the file scp-dbus-service.py but here is a summary. The general idea is that new instances of the New Printer and Printer Properties dialogs, as well as a single instance of the [...]]]></description>
			<content:encoded><![CDATA[<p>One of the new features in system-config-printer-1.3 is that various dialogs are can now be invoked using D-Bus.  The details of this are in the file <tt>scp-dbus-service.py</tt> but here is a summary.</p>
<p>The general idea is that new instances of the New Printer and Printer Properties dialogs, as well as a single instance of the Job Applet, can be requested, and these are given their own object paths.  Each has its own simple interface.</p>
<p><span id="more-896"></span></p>
<p>In this way, it would be fairly easy for an application to present a dialog for adjusting the printer properties for a queue, and also for starting a job applet.</p>
<p>Here are some more details:</p>
<p>Bus name: <tt>org.fedoraproject.Config.Printing</tt><br />
Object path: <tt>/org/fedoraproject/Config/Printing</tt></p>
<h3>Interface: <tt>org.fedoraproject.Config.Printing</tt></h3>
<h4>Method <tt>NewPrinterDialog</tt></h4>
<p>Creates a new instance of the New Printer dialog and returns its object path.</p>
<h4>Method <tt>PrinterPropertiesDialog</tt></h4>
<p>Creates a new instance of the Printer Properties dialog for a given printer name and returns its object path.</p>
<h4>Method <tt>JobApplet</tt></h4>
<p>If a Job Applet (system tray icon) instance is already active, returns its object path; otherwise creates a new one and returns its object path.</p>
<h3>Interface: <tt>org.fedoraproject.Config.Printing.NewPrinterDialog</tt></h3>
<h4>Method <tt>NewPrinterFromDevice</tt></h4>
<p>Show a dialog for creating a new printer, given a device URI and an IEEE 1284 Device ID.</p>
<h4>Method <tt>ChangePPD</tt></h4>
<p>Show a dialog for changing the PPD for an existing printer.</p>
<h4>Signal <tt>PrinterAdded</tt></h4>
<p>The printer has now been added.</p>
<h4>Signal <tt>PrinterModified</tt></h4>
<p>The PPD has now been changed.</p>
<h4>Signal <tt>DialogCanceled</tt></h4>
<p>The dialog has been cancelled by the user.</p>
<h3>Interface: <tt>org.fedoraproject.Config.Printing.PrinterPropertiesDialog</tt></h3>
<h4>Method <tt>PrintTestPage</tt></h4>
<p>Print a test page to this printer.</p>
<h4>Signal <tt>Finished</tt></h4>
<p>The dialog has now closed.</p>
<h3>Interface: <tt>org.fedoraproject.Config.Printing.JobViewer</tt></h3>
<h4>Method <tt>Quit</tt></h4>
<p>Stops the applet.</p>
<h4>Signal <tt>Finished</tt></h4>
<p>The applet is no longer running.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2011/04/13/using-system-config-printer-from-d-bus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Printing Test Day</title>
		<link>http://cyberelk.net/tim/2011/03/23/printing-test-day/</link>
		<comments>http://cyberelk.net/tim/2011/03/23/printing-test-day/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 17:31:52 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=890</guid>
		<description><![CDATA[Fedora 15&#8242;s Printing Test Day is next week: Tuesday March 29th. This test day is for testing all aspects of printing, including setting up the printer, sharing printers on the network, and printing jobs. If you have access to a printer, please come along and help test things out!]]></description>
			<content:encoded><![CDATA[<p><a href="http://cyberelk.net/tim/wp-content/uploads/2011/03/test-day-100.png"><img class="alignright size-full wp-image-892" title="test-day-100" src="http://cyberelk.net/tim/wp-content/uploads/2011/03/test-day-100.png" alt="" width="100" height="100" /></a>Fedora 15&#8242;s <a href="https://fedoraproject.org/wiki/Test_Day:2011-03-29_Printing">Printing Test Day</a> is next week: Tuesday March 29th.</p>
<p>This test day is for testing all aspects of printing, including setting  up the printer, sharing printers on the network, and printing jobs.</p>
<p>If you have access to a printer, please come along and help test things out!</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2011/03/23/printing-test-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a printer to CUPS</title>
		<link>http://cyberelk.net/tim/2011/02/23/adding-a-printer-to-cups/</link>
		<comments>http://cyberelk.net/tim/2011/02/23/adding-a-printer-to-cups/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 16:15:11 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cups]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=883</guid>
		<description><![CDATA[The GNOME 3 printer settings module looks like it will be great. The plan for adding a new printer is deceptively ambitious: the user interface design is that you click &#8220;+&#8221;, choose a printer device, and then click &#8220;Add&#8221; and the job is done. For those unfamiliar with printing, this sounds easy enough. To make [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://live.gnome.org/action/subscribe/Design/SystemSettings/Printers">GNOME 3 printer settings module</a> looks like it will be great. The plan for adding a new printer is deceptively ambitious: the user interface design is that you click &#8220;+&#8221;, choose a printer device, and then click &#8220;Add&#8221; and the job is done.</p>
<p>For those unfamiliar with printing, this sounds easy enough. To make the user interface as easy to use as that takes more work than you would think at first glance. It&#8217;s the direction I&#8217;ve been moving towards in <a href="http://cyberelk.net/tim/software/system-config-printer/">system-config-printer</a>.</p>
<p>Here is a description of the issues involved.</p>
<p><span id="more-883"></span></p>
<ol>
<li>Once you&#8217;ve found a printer, you then have to choose a driver for it.</li>
<li>Once you have a driver, it may need adjusting so that the installable<br />
options are correct.</li>
</ol>
<h3>Choosing a driver</h3>
<p>The thing to know about choosing a driver is that it is not well-defined. CUPS takes care not to take sides or pick favourites, and leaves it to the client application to decide which driver to use and indeed which drivers are likely to work for the printer.</p>
<p>There is no way to be certain you have a complete list of drivers that will work for a given printer. The most reliable way of matching up printers and drivers is to have each PPD file list all of the IEEE 1284 Device IDs for devices that it supports. This practice is not wide-spread, although there has been <a href="http://cyberelk.net/tim/2010/04/01/printer-device-ids-wanted/">progress towards this in Fedora</a>.</p>
<p>In response to a <strong>CUPS-Get-Devices</strong> IPP request, CUPS will have given you attributes describing the device: <em>device-id</em>, <em>device-make-and-model</em>, <em>device-info</em> and so on. Likewise, each driver has attributes in the response to <strong>CUPS-Get-PPDs</strong> describing itself, including <em>ppd-make-and-model</em>. However, <em>device-make-and-model</em> is not quite the same type of thing as <em>ppd-make-and-model</em>.</p>
<p>The <em>device-make-and-model</em> describes the make and model of the device. The <em>ppd-make-and-model</em> describes the make and model of the printer that the driver is written for, as well as the driver itself.</p>
<p>There is no canonical list of printer manufacturer names, and printer manufacturers routinely write their names differently, e.g. HP, Hewlett-Packard, Hewlett Packard, HEWLETT PACKARD, etc.</p>
<p>There are very often discrepancies between how the device describes its model name and how PPDs describe it, especially when it comes to drivers that support a range of models.</p>
<p>Since Fedora 13 we&#8217;ve had <a href="https://fedoraproject.org/wiki/Features/AutomaticPrintDriverInstallation">special RPM tags on driver packages</a> which can be used to give the user the opportunity to install any packages containing drivers that are known to support this device, once we know the <em>device-id</em>.  They are tagged with the make and model of the device as reported in its Device ID.</p>
<p>There isn&#8217;t really an easy way to pick the right driver.  What <a href="http://cyberelk.net/tim/software/system-config-printer/">system-config-printer</a> does is filter the available drivers using a variety of methods to find a list of the drivers that might support the printer, and then sort them into a preference order based on some XML-coded rules.  Ways of finding candidate drivers include:</p>
<ul>
<li>Matching MFG and MDL fields of the Device ID (but not all PPDs contain Device IDs)</li>
<li>Converting the <em>ppd-</em> and <em>device-make-and-model</em> strings at runtime into semi-canonical representations in hopes of getting a match that way (but this will not always be successful)</li>
<li>Looking for what look like model numbers and making this successively generic, e.g. 2215&#8230; 2210&#8230; 2200&#8230; 2000 (but the driver stands less chance of working the more generic the match)</li>
<li>Matching CMD fields of the Device ID (but this is only good for finding &#8220;generic&#8221; drivers, e.g. PCL)</li>
</ul>
<p>After this, some PPDs are eliminated: those that seem to match but which depend on an optional PostScript module which is not present in this device. If the Device IDs match in the MFG and MDL fields, but the PPD&#8217;s CMD field has POSTSCRIPT and the device&#8217;s CMD field does not, the PPD is likely no good. (This is a recent convention but has been adopted by Ricoh.)</p>
<p>The reason for sorting PPDs into a preference order is that there are lots of situations where one driver is most likely better than another.  The situations are numerous but include:</p>
<ul>
<li>If the manufacturer has supplied a driver, use that.</li>
<li>Otherwise, if we can send PostScript straight to the printer, we should probably do that rather than sending raster data.</li>
<li>&#8230;except if the printer does not come with a large amount of memory, in which case raster drivers may be more reliable.</li>
<li>Gutenprint is usually a high quality driver to use, so use that when possible.</li>
<li>&#8230;except if we&#8217;re printing to a colour laserjet, because Gutenrprint only provides black and white output at the moment.</li>
<li>Native CUPS drivers are generally preferred to the older-style Foomatic drivers.</li>
</ul>
<p>&#8230;and so on.  I wrote about the <a href="http://cyberelk.net/tim/2010/10/26/choosing-the-best-printer-driver/">mechanism used in system-config-printer</a> a while ago.  The current rules are <a href="http://git.fedorahosted.org/git/?p=system-config-printer.git;a=blob;f=xml/preferreddrivers.xml;hb=HEAD">here</a>.</p>
<p>Note that there may not be any driver you can choose that will work. There is no &#8220;fail-safe&#8221; driver that will work for all printers — not even sending them ASCII text or some sort of bitmap.</p>
<h3>Setting installable options</h3>
<p>Now, assuming you have chosen the right driver it may need some tweaking once it has been assigned.  This is because printers have optional parts, e.g. extra memory, duplexer units, binders, staplers etc.</p>
<p>CUPS provides a way to ask the printer to tell CUPS what those settings are: it&#8217;s a special print job of type <a href="http://www.cups.org/documentation.php/doc-1.4/spec-command.html">CUPS-Command</a> that says &#8220;AutoConfigure&#8221;.  There are attributes that will tell you whether CUPS-Command jobs are accepted, and if so whether the AutoConfigure command job is accepted.  If this is the case, sending this small job should complete the set-up of the PPD.</p>
<p>Most (if not all) non-PostScript printer drivers do not support the CUPS-Command format, however. If there are installable options in this case (which you can detect by seeing if there is an InstallableOptions group in the PPD), the only way to avoid asking the user about them is to hope the defaults are safe to use as they are.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2011/02/23/adding-a-printer-to-cups/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Avahi support in CUPS</title>
		<link>http://cyberelk.net/tim/2010/12/24/avahi-support-in-cups/</link>
		<comments>http://cyberelk.net/tim/2010/12/24/avahi-support-in-cups/#comments</comments>
		<pubDate>Fri, 24 Dec 2010 13:44:22 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=878</guid>
		<description><![CDATA[It&#8217;s been a long time coming but I&#8217;ve finally managed to get native Avahi support implemented in CUPS. This means that CUPS will now advertise its printers using Bonjour. The CUPS dnssd backend can also discover Bonjour print queues. At the moment it isn&#8217;t automatically discovered by CUPS, but I hope to get that part [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cyberelk.net/tim/wp-content/uploads/2010/12/Apple_Bonjour_Icon.png"><img class="size-full wp-image-879 alignright" title="Apple Bonjour Icon" src="http://cyberelk.net/tim/wp-content/uploads/2010/12/Apple_Bonjour_Icon.png" alt="" width="85" height="85" /></a>It&#8217;s been a long time coming but I&#8217;ve finally managed to get native Avahi support implemented in CUPS. This means that CUPS will now advertise its printers using Bonjour. The CUPS dnssd backend can also discover Bonjour print queues. At the moment it isn&#8217;t automatically discovered by CUPS, but I hope to get that part done once this work is accepted upstream.</p>
<p>The package with this patch is cups-1.4.5-9.fc15.</p>
<p>Merry Christmas!</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2010/12/24/avahi-support-in-cups/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

