<?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 &#187; printing</title>
	<atom:link href="http://cyberelk.net/tim/tag/printing/feed/" rel="self" type="application/rss+xml" />
	<link>http://cyberelk.net/tim</link>
	<description></description>
	<lastBuildDate>Wed, 23 May 2012 15:57:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Some benefits of printerd</title>
		<link>http://cyberelk.net/tim/2012/05/23/some-benefits-of-printerd/</link>
		<comments>http://cyberelk.net/tim/2012/05/23/some-benefits-of-printerd/#comments</comments>
		<pubDate>Wed, 23 May 2012 15:56:40 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[printerd]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=981</guid>
		<description><![CDATA[Recently I talked about a new print spooler under development, printerd. In that post I mentioned briefly how printerd is structured, but did not go very deeply into why or what the project is for. Firstly, printerd is experimental and is very far from being a functional print spooler. It doesn&#8217;t yet run any filters, [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I <a href="http://cyberelk.net/tim/2012/05/10/announcing-printerd" target="_blank">talked about</a> a new print spooler under development, printerd. In that post I mentioned briefly how printerd is structured, but did not go very deeply into why or what the project is for.</p>
<p>Firstly, printerd is experimental and is very far from being a functional print spooler. It doesn&#8217;t yet run any filters, for instance, and has no backends of its own to transport jobs to devices. So far it is just a test of what a Linux print spooler would look like if it were written today.</p>
<p>There are several problems printerd aims to solve. Some of the solutions come automatically from implementing it as a polkit-enabled D-Bus system service.  I mentioned one of them in the original post about printer: the fact of having an asynchronous client API. All D-Bus services can be used asynchronously thanks to the D-Bus client library. This approach means the print dialog will be able to use printerd without blocking (and without having to start another thread to use it).</p>
<p><span id="more-981"></span></p>
<p>Another benefit is the fact that security/authentication can be made much cleaner and more well integrated into a desktop system if polkit is the basis for policy decisions. Although there is some support for adding polkit support to CUPS in the shape of <a href="http://www.vuntz.net/journal/post/2010/02/19/A-few-words-about-cups-pk-helper..." target="_blank">cups-pk-helper</a>, the way this works is to effectively bypass the standard CUPS policy mechanism. In order to completely limit some operation from users, two different policies must be changed: the built-in CUPS policy in cupsd.conf, and the polkit policy for cups-pk-helper.</p>
<p>In contrast, printerd&#8217;s only interface is D-Bus and it uses polkit to authenticate operations. If extra security policy is added in future that cannot be expressed using polkit (for instance, printer-specific policy rules like CUPS has), that extra policy layer will be in addition to polkit, not an alternative. Currently, for example, cancelling a job requires that the user is permitted to use the org.freedesktop.printerd.job-cancel action (a polkit check), as well as being the user that submitted the job in the first place (an additional check). Both requirements must be fulfilled.</p>
<p>One more benefit of printerd is the idea of splitting the IPP server out from the local spooler. Currently printerd only spools files and does not provide IPP services but the idea is that when it does, this will be implemented out-of-process by a program that acts as a client to printerd. It will use printerd&#8217;s D-Bus interface, just like any other client. That way, users that want to print to local printers but are not interested in sharing those printers on the network don&#8217;t even have to run the IPP server. In fact, as printerd is an activatable system service, the spooler itself won&#8217;t even be running unless there is something for it to do.</p>
<p>By accepting only one format for printing, some complexity can be removed from the spooler. Generally people print from applications that generate PDF for printing. By using PDF as the required format, the task of selecting pages and arranging several pages onto each side (i.e. number-up) is hopefully made a little easier, as the structure of PDF makes this task more straightforward than PostScript does. Increasingly printers are able to understand PDF natively themselves. This means converting between formats can be kept to a minimum.</p>
<p>Finally, printerd is experimental, so ideas can be tested and developed. For example, I hope to get printerd to improve the latency between cancelling a job and having the printer stop feeding paper, by splitting the backend out of the filter pipeline, killing its input, and telling it to discard its send buffer. Another idea related to separating the filter pipeline from the backend is to begin filtering the next job before the backend finishes clearing out the last of its send buffer. I&#8217;m sure there are other areas for improvement that can be played around with in a project like printerd.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2012/05/23/some-benefits-of-printerd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing printerd</title>
		<link>http://cyberelk.net/tim/2012/05/10/announcing-printerd/</link>
		<comments>http://cyberelk.net/tim/2012/05/10/announcing-printerd/#comments</comments>
		<pubDate>Thu, 10 May 2012 14:50:58 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[printerd]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=976</guid>
		<description><![CDATA[For the last few weeks I&#8217;ve been working on an experimental new print spooler called printerd. It was designed in collaboration with Richard Hughes and it aims to be a modern print spooler for Linux. It is a polkit-enabled D-Bus system service, written using the GLib object system. Although modelled on concepts from IPP (Internet [...]]]></description>
			<content:encoded><![CDATA[<p>For the last few weeks I&#8217;ve been working on an experimental new print spooler called <a href="http://gitorious.org/printerd" target="_blank">printerd</a>. It was designed in collaboration with <a href="http://blogs.gnome.org/hughsie/" target="_blank">Richard Hughes</a> and it aims to be a modern print spooler for Linux.</p>
<p>It is a polkit-enabled D-Bus system service, written using the GLib object system. Although modelled on concepts from IPP (Internet Printing Protocol), printerd is not in itself an IPP server. Its only interface is D-Bus, although the aim is to be able to implement an IPP server on top of the D-Bus API as a separate process. Having a D-Bus interface means that applications wanting to print automatically get to use printerd asynchronously.</p>
<p>As a design decision, the range of input formats accepted by printerd will be very limited: essentially only PDF. The existing CUPS drivers and backends will be compatible with printerd.</p>
<p>There isn&#8217;t much written yet aside from the basic framework and a very simple command line tool.</p>
<p>Feel free to take a look around: <a href="http://gitorious.org/printerd" target="_blank">http://gitorious.org/printerd</a></p>
<p><span id="more-976"></span></p>
<p><a href="http://cyberelk.net/tim/wp-content/uploads/2012/05/dfeet.png"><img class="alignnone size-large wp-image-977" title="dfeet" src="http://cyberelk.net/tim/wp-content/uploads/2012/05/dfeet-451x1024.png" alt="" width="451" height="1024" /></a></p>
<pre>$ pd-client -v print-files myprinter ~/Documents/portrait-a4.pdf
TI:15:09:58    getting printerd manager
TI:15:09:58    Getting printer /org/freedesktop/printerd/printer/myprinter
TI:15:09:58    Job created: /org/freedesktop/printerd/job/1
TI:15:09:58    Document added
TI:15:09:58    Job started
Job path is /org/freedesktop/printerd/job/1

# printerd -v
TI:15:02:46    Entering main event loop
TI:15:02:46    add device usb://HP/DESKJET%20990C?serial=US05N1J00XLG [...]
TI:15:02:46    Connected to the system bus
TI:15:02:46    Acquired the name org.freedesktop.printerd on the system message bus
TI:15:08:52    Handling GetDevices
TI:15:08:57    Handling GetDevices
TI:15:09:12    Checking authorization of :1.642 for org.freedesktop.printerd.printer-add
TI:15:09:12    Authorized
TI:15:09:12    Creating printer from device HEWLETT_PACKARD_DESKJET_990C_US05N1J00XLG
TI:15:09:12    add printer myprinter
TI:15:09:58    Checking authorization of :1.647 for org.freedesktop.printerd.job-add
TI:15:09:58    Authorized
TI:15:09:58    Creating job for printer myprinter
TI:15:09:58    New job path is /org/freedesktop/printerd/job/1
TI:15:09:58    Created job path is /org/freedesktop/printerd/job/1
TI:15:09:58    [Job 1] Adding document
TI:15:09:58    [Job 1] Got file descriptor: 10
TI:15:09:58    [Job 1] Starting job
TI:15:09:58    [Job 1] Spooling
TI:15:09:58    [Job 1]   Created temporary file /tmp/printerd-spool-AHFWDW
TI:15:09:58    [Job 1]   Set job state to pending
TI:15:09:58    Job 1 changed state: pending
TI:15:09:58    Printer for job 1 idle so starting job
TI:15:09:58    [Job 1] Starting to process job
TI:15:09:58    [Job 1] Using device URI usb://HP/DESKJET%20990C?serial=US05N1J00XLG
TI:15:09:58    [Job 1] Executing /usr/lib/cups/backend/usb
TI:15:09:58    [Job 1]  Env: DEVICE_URI=usb://HP/DESKJET%20990C?serial=US05N1J00XLG
TI:15:09:58    [Job 1]  Arg: usb://HP/DESKJET%20990C?serial=US05N1J00XLG
TI:15:09:58    [Job 1]  Arg: 1
TI:15:09:58    [Job 1]  Arg: :1.647
TI:15:09:58    [Job 1]  Arg: job 1
TI:15:09:58    [Job 1]  Arg: 1
TI:15:09:58    [Job 1]  Arg:
TI:15:09:58    [Job 1] Read 1024 bytes from spool file
TI:15:09:58    Job 1 changed state: processing
TI:15:09:58    [Job 1] Wrote 1024 bytes to backend
TI:15:09:58    [Job 1] Read 1024 bytes from spool file
TI:15:09:58    [Job 1] Wrote 1024 bytes to backend
TI:15:09:58    [Job 1] Read 1024 bytes from spool file
TI:15:09:58    [Job 1] Wrote 1024 bytes to backend
TI:15:09:58    [Job 1] Read 1024 bytes from spool file
TI:15:09:58    [Job 1] Wrote 1024 bytes to backend
TI:15:09:58    [Job 1] Read 1024 bytes from spool file
TI:15:09:58    [Job 1] Wrote 1024 bytes to backend
TI:15:09:58    [Job 1] Read 1024 bytes from spool file
TI:15:09:58    [Job 1] Wrote 1024 bytes to backend
TI:15:09:58    [Job 1] Read 1024 bytes from spool file
TI:15:09:58    [Job 1] Wrote 1024 bytes to backend
TI:15:09:58    [Job 1] Read 1024 bytes from spool file
TI:15:09:58    [Job 1] Wrote 1024 bytes to backend
TI:15:09:58    [Job 1] Read 564 bytes from spool file
TI:15:09:58    [Job 1] Wrote 564 bytes to backend
TI:15:09:58    [Job 1] Spool finished
TI:15:09:58    [Job 1] backend: STATE: +connecting-to-device
TI:15:09:58    [Job 1] backend: DEBUG: Printer using device file "/dev/usb/lp0"...
TI:15:09:58    [Job 1] backend: STATE: -connecting-to-device
TI:15:09:58    [Job 1] backend: DEBUG: backendRunLoop(print_fd=0, device_fd=3, snmp_fd=-1, addr=(nil), use_bc=1, side_cb=0x7f053adc6c30)
TI:15:09:58    [Job 1] backend: DEBUG: Read 8192 bytes of print data...</pre>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2012/05/10/announcing-printerd/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Session printing</title>
		<link>http://cyberelk.net/tim/2012/03/08/session-printing/</link>
		<comments>http://cyberelk.net/tim/2012/03/08/session-printing/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 17:52:55 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[cups]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=956</guid>
		<description><![CDATA[There has been a discussion on the Fedora devel mailing list recently about user session printing: why that might be useful, and in what circumstances it makes sense. Where I can see it can make some sense to have printing entirely in the user session is for PDF printing to smart services hosted elsewhere: e.g. [...]]]></description>
			<content:encoded><![CDATA[<p>There has been <a href="http://lists.fedoraproject.org/pipermail/devel/2012-March/163610.html" target="_blank">a discussion on the Fedora devel mailing list recently</a> about user session printing: why that might be useful, and in what circumstances it makes sense.</p>
<p>Where I can see it can make some sense to have printing entirely in the user session is for PDF printing to smart services hosted elsewhere: e.g. the office CUPS server, or Google Cloud Print.  Applications produce PDF, so for printing to these types of service there is nothing to do but send the PDF (along with any print options).</p>
<p><span id="more-956"></span></p>
<p>A little about Google Cloud Print: this is a service that allows you to register your local printers with their service, and share those printers with other people.  It currently works as part of Chrome: it maintains an XMPP connection to Google so that incoming jobs can be received and passed on to the local CUPS queue.  For printing jobs to it, it is simply an authenticated web service.</p>
<p><a href="http://cyberelk.net/tim/wp-content/uploads/2012/03/session-printing.png"><img class="alignnone size-medium wp-image-957" title="session-printing" src="http://cyberelk.net/tim/wp-content/uploads/2012/03/session-printing-450x318.png" alt="" width="450" height="318" /></a></p>
<p>The GTK print dialog supports multiple print backends, and currently &#8216;cups&#8217; is the one we use for printing.  This communicates with the locally-running cupsd.</p>
<p>Printing is more than simply getting capabilities and submitting jobs though: we also need to monitor the status of submitted jobs, and perform actions on those jobs such as pause, resume, and cancel.</p>
<p>Currently job status monitoring is performed in gsd-printer, which displays notifications when a job has completed etc, and job management actions are implemented in the &#8220;Printers&#8221; panel of the Systems Settings<br />
application.</p>
<p>Adding support for printing to PDF-capable print services directly from the session could be implemented as follows.</p>
<p>A new session service for printing could be created, providing methods for obtaining a list of printers, explicitly adding/removing printers, and with properties for finding out the current state of each printer and whether it is reporting problems.  It could also provide methods for retrieving the list of jobs for each printer, performing actions on those jobs, and have properties for the state of each job.</p>
<p>This service could have plug-ins for dealing with the locally-running cupsd; with CUPS/IPP servers on the network; and with Google Cloud Print.</p>
<p>For the &#8220;network IPP&#8221; plug-in, it could discover available CUPS (and IPP Everywhere) queues using Avahi, and show in the list of printers only those queues that handle PDF.  Additionally, the print dialog could<br />
allow IPP print servers to be added by hostname (for CUPS) or URI (for network printers which speak IPP and handle PDF).</p>
<p>For the &#8220;cloudprint&#8221; plug-in, it could interrogate the Google Cloud Print server to determine the list of available queues. (The &#8220;Online Accounts/Google&#8221; part of System Settings knows how to log in.)</p>
<p>For job status feedback, gsd-printer could instead query the new service. (Or perhaps the service would be implemented in gsd-printer?)</p>
<p>For job management, the printer panel in System Settings could perform actions through the new service.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2012/03/08/session-printing/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<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>7</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>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>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>Presenting at OpenPrinting Summit today</title>
		<link>http://cyberelk.net/tim/2010/04/15/presenting-at-openprinting-summit-today/</link>
		<comments>http://cyberelk.net/tim/2010/04/15/presenting-at-openprinting-summit-today/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 07:47:02 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cups]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[PackageKit]]></category>
		<category><![CDATA[printing]]></category>
		<category><![CDATA[system-config-printer]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=838</guid>
		<description><![CDATA[Just a quick note that I&#8217;ll be presenting by phone today, Thursday 15th April, at the OpenPrinting Summit on the topic of automatic printer driver installation in Fedora 13.  The talk is at 1600 UTC / 1700 BST, and was not Wednesday as scheduled.  The schedule hasn&#8217;t been updated yet, but when it is you [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note that I&#8217;ll be presenting by phone today, Thursday 15th April, at the OpenPrinting Summit on the topic of <a href="https://fedoraproject.org/wiki/Features/AutomaticPrintDriverInstallation">automatic printer driver installation in Fedora 13</a>.  The talk is at 1600 UTC / 1700 BST, and was not Wednesday as scheduled.  The schedule hasn&#8217;t been updated yet, but when it is you can find it and the dial-in information <a href="https://www.linuxfoundation.org/collaborate/workgroups/lf/openprinting-summit-san-francisco-2010">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2010/04/15/presenting-at-openprinting-summit-today/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Printer Device IDs wanted</title>
		<link>http://cyberelk.net/tim/2010/04/01/printer-device-ids-wanted/</link>
		<comments>http://cyberelk.net/tim/2010/04/01/printer-device-ids-wanted/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 17:40:53 +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=832</guid>
		<description><![CDATA[The new feature in Fedora 13 for installing printer drivers automatically makes it all the more important to have correct IEEE 1284 Device IDs for printers.  Unfortunately many drivers shipped in Fedora do not declare Device IDs for all the printers they support, and some of the ones we do have are wrong. You can [...]]]></description>
			<content:encoded><![CDATA[<p>The new feature in Fedora 13 for <a href="https://fedoraproject.org/wiki/Features/AutomaticPrintDriverInstallation">installing printer drivers automatically</a> makes it all the more important to have correct IEEE 1284 Device IDs for printers.  Unfortunately many drivers shipped in Fedora do not declare Device IDs for all the printers they support, and some of the ones we do have are wrong.</p>
<p>You can help put this right, whether you are running Fedora 13 Alpha, or Fedora 11/12.</p>
<p><span id="more-832"></span></p>
<p>Information on collecting Device IDs is given on the <a href="https://fedoraproject.org/wiki/Test_Day:2010-03-25_Printing#Device_ID_checking">Printing Test Day page</a> but here is a good way of doing it:</p>
<ol>
<li>Make sure you have the foomatic, gutenprint-cups, and hpijs packages installed</li>
<li>Connect and switch on your printer(s) &#8212; yes, even network ones</li>
<li>
<pre>git clone http://git.fedoraproject.org/git/system-config-printer.git
cd system-config-printer
su -c ./check-device-ids.py</pre>
</li>
<li>If you see &#8220;MISSING&#8221; in the output, file a bug in <a href="https://bugzilla.redhat.com/">Bugzilla</a> against the relevant driver</li>
</ol>
<p>Incidentally, some statistics on Device IDs in Fedora 13:</p>
<ul>
<li>We have at least 10,100 drivers</li>
<li>Of those, over 6,200 have Device IDs associated with them</li>
<li>That means we&#8217;re missing Device IDs for nearly 40% of all our printer drivers</li>
</ul>
<pre>$ lpinfo -l -m | grep 'device-id = ' | wc -l
10135
$ lpinfo -l -m | grep 'device-id = $' | wc -l
3922
</pre>
<p><small>UPDATED:</small> Changed instructions to run check-device-ids.py using su.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2010/04/01/printer-device-ids-wanted/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Printing Test Day this Thursday</title>
		<link>http://cyberelk.net/tim/2010/03/23/printing-test-day-this-thursday/</link>
		<comments>http://cyberelk.net/tim/2010/03/23/printing-test-day-this-thursday/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 11:49:11 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[printing]]></category>
		<category><![CDATA[test day]]></category>

		<guid isPermaLink="false">http://cyberelk.net/tim/?p=829</guid>
		<description><![CDATA[This Thursday (March 25th) is when a Printing Test Day is being held for Fedora.  This is an opportunity to check that printing will work with your printer in Fedora 13, and to help find bugs to be fixed before release date. One of the new features in Fedora 13 is the automatic installation of [...]]]></description>
			<content:encoded><![CDATA[<p>This Thursday (March 25th) is when a <a href="https://fedoraproject.org/wiki/Test_Day:2010-03-25_Printing">Printing Test Day</a> is being held for Fedora.  This is an opportunity to check that printing will work with your printer in Fedora 13, and to help find bugs to be fixed before release date.</p>
<p>One of the new features in Fedora 13 is the <a href="https://fedoraproject.org/wiki/Features/AutomaticPrintDriverInstallation">automatic installation of printer drivers</a> when USB printers are connected.  For this feature to work, specific information about each printer model needs to be stored in the relevant driver packages.  Some of this is done but we need your help to test it and to collect more Device ID strings.</p>
<p>Please come along and join in!</p>
]]></content:encoded>
			<wfw:commentRss>http://cyberelk.net/tim/2010/03/23/printing-test-day-this-thursday/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

