Network printing

It’s nearly two years since I wrote about session printing, in which the user doesn’t need to modify a locally running CUPS instance in order to print to a network printer. The main advantage of having printing running entirely in the user session is that no special privileges are needed. After all, all you need to do is send the document over the network.

So what’s the current state of play?

The main objective was to avoid the user needing to enter a password to gain privileges when all they want to do is print to a printer using the network.

There are three main cases to look at:

  1. a CUPS server running on the local network;
  2. a public Internet service;
  3. a network-capable printer directly connected to the network.

CUPS server

One of the plans for the session printing idea was that network printers would be discovered using DNS-SD when the print dialog is presented. As it turned out, the CUPS maintainer had independently had the same idea about this, and CUPS 1.6 moved discovery from the scheduler to the client library. It uses Avahi to find other shared CUPS queues on the local subnet.

The GTK+ print dialog doesn’t use the client library directly but uses Avahi for discovery in the same way (thanks to Marek Kasik).

I wrote a patch for the Qt print dialog to get it to use the new API in the client library. This means that it, too, can use Avahi to discover local CUPS servers.

Public Internet service

Support for Google Cloud Print in the GTK+ print dialog has now been accepted upstream, although it is not yet able to display printer capabilities or adjust any printer settings. Other cloud printing solutions I’ve looked at don’t have a documented job submission API other than sending documents by email.

Network printer

A growing number of printers support IPP Everywhere. These printers don’t need special drivers, and look a little like queue-less CUPS servers. DNS-SD is used for discovery, and print job settings are adjusted using IPP attributes. The printer declares supported and default values for known keyword options.

The latest version of cups-filters includes a cups-browsed daemon that will discover these printers and automatically create local CUPS queues for them, with no user interaction at print-time.

It is up to the print dialog to interrogate the printer about its supported options and present those to the user. The bug report for GTK+ has details.


Since the idea first came about, the requirements changed. I had little time to put into working on it myself.

For GTK+ at least, only two pieces are missing: printer settings for Google Cloud Print, and for IPP Everywhere printers.






6 responses to “Network printing”

  1. Kevin Kofler avatar

    But we had to drop your Qt patch from Fedora Qt packaging because it causes more problems than it solves, due to bugs/limitations in that new CUPS client-side discovery API. We are still waiting for a fix for those issues. We cannot enable the patch otherwise.

    1. Tim avatar

      Sorry about that. This update should fix it.

  2. Anonymous avatar

    For locally attached printers, or non-discoverable network printers (for instance, JetDirect printers), what about running an instance of CUPS entirely inside the user session with user privileges?

    1. Tim avatar

      Yes, that’s a possible idea.

      1. Stefan Brüns avatar
        Stefan Brüns

        I dont think an CUPS instance is needed at all. Currently when you print to an USB attached inkjet printer with a gutenprint driver:
        – CUPS provides an http server accepting IPP requests
        – ghostscript transforms the (e.g.) PDF to raster data
        – a gutenprint filter binary does raster to printer specific command stream
        – a usb “backend” opens the connection to the printer

        All these components communicate via pipes currently.

        Why not create a monolithic program, dynamically linking to libgs, libgutenprint and libusb? This makes many thinks easier, e.g. you can query libgutenprint for the supported attributes, but you don’t have to convert these to PPD and then back to IPP attributes.

  3. Trudie avatar

    I use the cups functionality ” print to pdf” a lot! Eg to store recipes from the internet to our network drive at home. We work in an Ubuntu 16.04 LTS environment.

    Unfortunately in the dialog box where I can select the path were the file should be saved to I can’ t select the network drive where I’d like to store it.

    How can I fix this? Thanks for your help!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.