User Tools

Site Tools


gsoc:google-summer-code-2024-openprinting-projects

This is an old revision of the document!


Google Summer of Code 2024: OpenPrinting projects

Contact

Important: We protect the e-mail addresses of our mentors and mailing lists against spam bots. Please replace all occurrences of “ at ” and “ dot ” by “@” and “.” resp.

Mailing list: printing-architecture at lists dot linux dot dev (Instructions)

IRC: #openprinting on Libera.Chat

Our code repositories: OpenPrinting GitHub

What is OpenPrinting? How did it all begin? What did we achieve? What are we currently doing?

Keep in touch with OpenPrinting's state of the art.

Code License: See project descriptions. Most of our own projects are Apache 2.0 (CUPS, libcupsfilters, libppd, PAPPL, pappl-retrofit, PDFio, …) and some are MIT (CPDB), but we mentor also contributions to other projects, like GNOME, KDE, LibreOffice, … which have their own licenses.

Organization Administrators

The participation of the Linux Foundation in the Google Summer of Code is organized by Till Kamppeter (till at linux dot com) and Aveek Basu (basu dot aveek at gmail dot com).

Introduction

Videos/Podcasts

Printer Drivers get Printer Applications

OR The New Architecture (What it is, Video)

CUPS, printing environment used by Linux and most other non-Windows operating systems, supports the different printer models with the help of printer drivers, consisting of PPD (PostScript Printer Description) files to describe the printer's capabilities, filters to convert the incoming print jobs into the printer's native language, and sometimes also backends, to support non-standard communication protocols between the computer and the printer hardware.

Modern printers do not need printer drivers (printer-model specific software or data) as they use standard methods for everything: DNS-SD to advertise themselves in the network, IPP (Internet Printing Protocol, at least version 2.0) as a communication protocol with which the printer cannot only print and inform about its status but also provide a complete description of its capabilities, and known standard PDLs (Page Description Languages). These are driverless IPP printers following the IPP Everywhere, Apple AirPrint, Mopria, and/or Wi-Fi Direct Print standards. So printer drivers are only needed for specialty printers or legacy printers.

See also the Debian documentation about driverless printing with CUPS.

We are also moving to sandboxed packaging in modern operating system distributions, where applications are completely isolated from each other, having their own file systems and well-defined paths and interfaces to communicate with other applications.

And already several years ago we moved from PostScript to PDF as standard data format for print jobs.

All this made us rethink how printer drivers should look like. Michael Sweet has already deprecated PPD files more than a decade ago, when we switched to PDF-centric printing (and the PostScript format is also not developed any more by Adobe), but due to lack of a replacement we have continued using them. Some years ago Michael Sweet introduced the concept of Printer Applications as replacement for the classic CUPS printer drivers.

A Printer Application is nothing else than a daemon which emulates a driverless IPP (at least IPP Everywhere) network printer. It advertises itself, speaks IPP, and understands standard protocols as an actual network printer, and even has an administration web interface. Internally, it converts the incoming jobs to the printer's native, often proprietary PDL and sends them off to the physical, non-driverless printer on USB, parallel port or with any network protocol like LPD or raw socket (port 9100). The capabilities which the Printer Application reports on IPP requests or in its DNS-SD record are the capabilities of the printer.

This solves many problems:

  • No use of the obsolete PPDs any more
  • For CUPS (or any other printing environment) driverless IPP printers and Printer Applications behave the same, no printer driver support needed any more
  • If CUPS is in a sandboxed package (like the CUPS Snap) it is not possible to install classic CUPS drivers, as an external program cannot access CUPS' directories for PPD files, filters, and backends. The Printer Application only communicates with CUPS via IP, as a network printer, so CUPS can be sandboxed.
  • Printer Applications themselves can be sandboxed, so they can be distributed as OS-distribution-independent packages on a central download place (like the Snap Store). This reduces the development and testing cost for the printer manufacturers a lot.

Now we already have retro-fitted practically all of the classic printer drivers, which are available as free software and come with typical distributions like Debian, into Printer Application Snaps which are available in the Snap Store.

And for many label printers we have already a native (no retro-fit from classic driver) Printer Application: LPrint.

In less than 1 year from now, CUPS 3.x will be released and this is the first CUPS which has dropped PPD and printer driver support, requiring Printer Applications. See the roadmap.

Scanner Applications

Having multi-function printers in mind (printer, scanner, also often fax in one device) the IPP Scan standard got created, which allows the use of IPP for both printing and scanning. Especially driverless scanning is possible using the same principles as with driverless printing. Manufacturers actually use eSCL and WSD for driverless scanning instead (also supported in free software), all these protocols help to get scanning working in environments of only sandboxed packages and to more easily distribute scanner drivers.

Currently, SANE is the standard platform for scanning. Here a frontend, for example a GUI user application, like simple-scan or X-SANE, looks for backends (scanner drivers) which are supplied as dynamically loadable shared libraries in a given directory, runs each backend so that it returns back which of its supported scanners are currently present, having the frontend end up with a list of all currently available scanners and through which backend they are available.

This architecture is not viable for sandboxed packaging, where the user applications are in separate sandboxed packages and one wants to be able to add scanner drivers, preferably each scanner driver also in a sandboxed package.

So as we create Printer Applications we create Scanner Applications emulating a driverless IPP scanner using any of the above-mentioned driverless scanning standards. We have settled on eSCL for this currently, as it is the most-used standard by the scanner industry and its specification is publicly available. Now scanner drivers can be distributed in individual sandboxed packages, OS-distribution-independent, and for multi-function devices one can even distribute a combined Printer/Scanner Application. The sandboxed packages of user applications which scan only need a backend for IPP Scan and this discovers all Scanner Applications (and scanners in native network devices).

So we are going to replace SANE in the role of an interface between scanning user applications and scanner drivers by the sandboxing-ready eSCL. SANE will continue to exist, but to provide the legacy scanner drivers enclosed in a Scanner Application.

Work on extending the Printer Application framework PAPPL has already been started in GSoC 2021 and continued in GSoC 2022 and 2023.

Desktop Integration

Most print jobs are created from desktop applications. Users create printable documents with applications like LibreOffice or GIMP, they receive documents by e-mail, want to print web content which they see in their browsers, … Therefore working support for printing in desktop environments is essentially important.

There are two types of user interfaces needed. One is the print dialog which pops up when printing out of an application. It allows to choose on which of the available printers to print and to control details of how the content gets printed, like paper type and size, print quality, double-sided printing, … The second interface is the printer setup tool, for finding and configuring printers to make them available for printing, and to se useful defaults for the most common printing tasks.

This functionality is usually available for all desktop environments and applications, but with the New Architecture we need to change it, because print destinations are now defined differently.

Up to CUPS 2.x a print destination was defined by a CUPS queue, defined in the printers.conf configuration file of CUPS, consisting of a name under which the queue is identified, a device URI which defines the way how to access the printer hardware, and the PPD file telling about the driver to use and the capabilities of the printer.

This is not needed any more for modern, driverless IPP printers and CUPS has already started to support them explicitly in the 2.x generation. For the New Architecture a print destination is an IPP print service, advertised via DNS-SD and all needed information to print on it can be retrieved by IPP.

For print dialogs we separate the GUI and the communication with CUPS into separate frontend (print dialog) and backend (CUPS communication) using the Common Print Dialog Backends. So the CUPS backend is maintained by OpenPrinting, as CUPS itself, meaning that it will always keep pace with the development of CUPS, and changes in CUPS, like the New Architecture, will go into it right away. By this we only need to take care that all existing print dialogs (GNOME/GTK, KDE/Qt, Mozilla (Firefox/Thunderbird), Chromium Browser, LibreOffice) get CPDB support.

Printer setup tools (GNOME Control Center, KDE Settings, system-config-printer) need to list IPP print destinations on their main view, and give appropriate configuration options on them to the user, especially a button to quickly open the web admin interface, also the destinations should get listed in logical groups,to have printing and fax out of a multi-function device together, or the printers supported by the same Printer Application.

Also the “Add Printer” part of the printer setup tools still makes sense.It has to list non-driverless printers and assign Printer Applications instead of PPD files to them.

Actually we will not remove the old functionality from the printer setup tools and replace it by the new on. Instead, we add the new functionality so that the tool works with any CUPS version, and in the case of CUPS 2.x they will then handle both permanent CUPS queues with PPD files and IPP print destinations which CUPS can print on without needing to create a queue. This way distributions will be able to switch to CUPS 3.x at any time and no synchronous switch of both CUPS and the printer setup tool(s) is required.

Parts of this work got already done, especially most of the “Printers” module in GNOME Control Center by Mohit Verma during GSoC 2022 and 2023, CPDB support in the GTK print dialog and most of the CPDB support in the Qt print dialog by Gaurav Guleria in GSoC 2022 and CPDB support for the print dialog of the Chromium Browser by Kushagra Sharma in GSoC 2023.

For a smooth transition to CUPS 3.x in all distributions we need to add support for the New Architecture in all desktop environments and all applications. Especially if we want to switch Ubuntu to CUPS 3.x we cannot only take GNOME into account, as the core of the Ubuntu distribution is also used by the 10 official, community-maintained flavors which cover a wide range of desktops. Therefore we were not able to switch Ubuntu 23.10 to use the CUPS Snap.

What we are currently doing at OpenPrinting

At least what we are doing on the coding side is to move the architecture of Printer and Scanner Applications and the support for sandboxed packages for printing and scanning forward. Especially we want to get printing and scanning “just work” also in completely sandboxed OS distributions and allow printer and scanner hardware manufacturers to provide drivers as distribution-independent, easily downloadable and installable packages.

This principally happens in the following projects:

See also

Project Ideas

Desktop integration: CPDB support for the print dialogs of Mozilla (Thunderbird/Firefox) and LibreOffice

Desktop Integration: Update system-config-printer for the New Architecture of printing

Desktop Integration: User interfaces for using OAuth2 with printers and scanners

Replace QPDF by PDFio as PDF manipulation library in libcupsfilters (cfFilterPDFToPDF() filter function and others)

1 contributor full-size (350 hours).

Like CUPS, libcupsfilters is principally written in regular C and not in C++. We want to avoid C++ as it has often problems with binary compatibility and the mechanism with which the Debian/Ubuntu build services auto-detect dependencies between Debian packages get very awkward with C++.

But libcupsfilters still depends on one library which is written in C++, QPDF, a library for manipulating PDF files: Scaling up and down, moving around on the page, rotating, combining several source pages on one destination page, turning filled PDF forms into straight PDF, … QPDF is used by the filter functions cfFilterPDFToPDF(), cfFilterBannerToPDF(), cfFilterGSToRaster(), and cfFilterRasterToPDF().

Michael Sweet, author of CUPS, has some years ago started the PDFio project. This is a PDF handling and manipultion library, as QPDF is, but it is fully written in standard, regular C, no C. Therefore we want to replace the use of QPDF by PDFio and this is what this GSoC project is about. But for such a switchover we must take into account that QPDF is a complex and sophisticated project with a lot of features (it got even new features by two GSoC projects of OpenPrinting) while PDFio is a young project run as one of the many small projects by Michael Sweet and we must be very careful to see whether it does not miss any important feature. Especially we must look after correct printing of filled-in PDF forms and PDF annotations. So part of the project will be investigation of suitability and perhaps also work with Mike to get needed features added. And after the switchover thorough testing is needed to avoid any regressions after this impactful change. Mentors: Till Kamppeter, Project Leader OpenPrinting (till at linux dot com), Michael Sweet, author of CUPS and PAPPL (msweet at msweet dot org), Ira McDonald (blueroofmusic at gmail dot com), TBD Desired knowledge: %%C/C++%%, CUPS Code License: Apache 2.0 =====CPDB backend for IPP infrastructure/cloud printers===== =====Turn cups-browsed into a Printer Application===== =====Printer Application for Braille embossers===== =====Adding support for the new functionality/attributes of IPP Everywhere 2.x to libcupsfilters and the Common Print Dialog Backends (CPDB)===== 1-2 contributors full-size (350 hours). Driverless IPP printing is implemented with four, very similar standards, IPP Everywhere, AirPrint, Mopria, and Wi-Fi Direct Print. Most [[https://openprinting.github.io/printers/

gsoc/google-summer-code-2024-openprinting-projects.1705719581.txt.gz · Last modified: 2024/01/20 02:59 by till