User Tools

Site Tools


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

Google Summer of Code 2023: 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-foundation dot org

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

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

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 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.

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

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 printers qualify to be driverless as the support Apple's Airprint, the standard which got widely used first, to allow printing from iPhones and other iOS devices, but IPP Everywhere from the Printer Working Group is the first free and open standard.

IPP Everywhere is under continuous development. The current version printers are certified on is 1.1, but 2.0 is close to its release. It adds new attributes to cover the most recent printers.

The software provided on OpenPrinting is all based on IPP Everywhere 1.x and to make use of printer features covered by the new version of the standard it needs to get updated.

The contributor's task is to add the new features according to the new specifications and to update everything to conform with IPP Everywhere 2.0, IPP Driver Replacement Extensions v2.0, and IPP Job Extensions v2.1. Especially the libcupsfilters and CPDB must “understand” the new attributes and choices, libcupsfilters needs to implement the new attribute's functionality, and CPDB to carry through the new attributes to the print dialogs.

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 support for application's print dialogs: Firefox, Chromium, LibreOffice, ...

1 contributor full-size (350 hours).

Most print jobs are sent via the print dialog of a desktop application, like evince, Chrome, LibreOffice, DarkTable, … Print dialogs are usually, like “Open …” or “Save as …” dialogs, provided by the GUI toolkits, in most cases GTK or Qt, sometimes applications come also with their own creations, like LibreOffice or Chromium.

Problem here is usually not the design of the dialog itself, most are actually easy to use, but the way how they connect to CUPS (and also to other print technologies) and how well this connection code is maintained and kept up-to-date.

GUI toolkit projects are large projects, often with long release cycles and all with a certain inertia, and there are things which many people are eager to work on, and others, like print dialogs, which have to be there but no one is really motivated to push their development forward and do the needed maintenance work.

An important part of the maintenance of a GUI toolkit is that it interfaces well and correctly with the underlying operating system, graphics, sound, storage, …, and printing! The OS is under continuous development, things are changing all the time, components get replaced by others, printing is CUPS for 23 years, but within CUPS we have also changes, and they need to be taken care of in the print dialogs.

Several years back, CUPS started to create temporary queues for driverless IPP network printers (or remote CUPS printers, which are emulations of IPP printers), which are only physically available when they are accessed (capabilities are polled or job printed). Print dialogs used an old API which did not support this, the temporary queues did not appear in the dialog, a helper daemon, cups-browsed had to convert the temporary queues into physical queues as a workaround. The correct solution had been to change the print dialogs to a newer CUPS API which supports these queues, but no one at the GUI toolkit projects has felt responsible and taken the time for this update for many years. Only recently this got fixed.

This made me introducing the Common Print Dialog Backends (CPDB) back in 2017, a de-coupling of the print technology (CUPS, print-to-file, that time also Google Cloud Print) from the GUI. The GUI projects have to adopt the CPDB support only once and then OpenPrinting (or any upcoming cloud printing projects) takes care of the CPDB backend for the print technologies to be up-to-date with any changes. This way print technology projects can react quickly and are not dependent any more on the GUI toolkit’s inertia.

The print dialogs of the major GUI toolkits, GTK, Qt, got CPDB support added in GSoC 2022, but several applications come with their own creation of a print dialog. AFAIK these are Firefox/Thunderbird (Mozilla), Chromium/Chrome (Google), and LibreOffice. Also these dialogs need to get CPDB support to make CPDB universal.

Then we are especially prepared for the switch to CUPS 3.x which does not support PPD files any more, as the CUPS backend of CPDB is already using only CUPS APIs not handling PPD files. And we are also prepared for IPP infrastructure/cloud printing for which we also want to create a CPDB backend (see below).

The contributor's task is to get CPDB into the print dialogs upstream, the UI of them does not need to be changed. Dialogs to be treated are Mozilla for Firefox and Thunderbird, Chromium/Chrome, LibreOffice, and any other application-specific dialog. For LibreOffice there was already worked on CPDB support back in 2017, but in the meantime things have changed and the dialog needs to get updated, especially for the new features of CPDB 2.x (human-readable strings/translations, option groups, …).

For the CPDB integration we do not need UI design work.

Mentors: Till Kamppeter, Project Leader OpenPrinting (till at linux dot com), Gaurav Guleria (gaurav dot gen3 at gmail dot com), Firefox/Thunderbird/Mozilla developers, Chrome developers, LibreOffice developers, TBD

Desired knowledge: C/C++, GTK or Qt, DNS-SD/Avahi, CUPS/IPP

Code License: MIT, GPL-2+ and LGPL-2+

Scanning support in PAPPL

1 contributor full-size (350 hours).

In the Google Summer of Code 2021, Bhavna Kosta has started the work on Scanning support in PAPPL (Talk on OpenPrinting micro-conference 2021: Slides, Video) so that PAPPL not only can be used for creating Printer Applications (emulation of a driverless IPP printer) but also for creating Scanner Applications (emulation of a driverless eSCL scanner), or even an emulation of a driverless IPP multi-function device.

She has created the needed data structures and API functions needed to extend PAPPL for supporting scanners.

After that, in the Google Summer of Code 2022, Rishabh Maheshwari has then implemented an eSCL parser so that Scanner Applications emulate eSCL scanners, the standard protocol which the hardware industry uses for driverless scanning.

Next steps to complete the support are the following:

  • Implementation of the PAPPL internal functionality, integration of the eSCL interpreter code, response to the eSCL inquires, interface for callback functions with the actual scanner driver code, …
  • Create a test scanner driver emulating a scanner without needing actual scanner hardware, for example serving out static images from a directory.
  • A retro-fit SANE interface to be added to the pappl-retrofit project (similar to AirSANE), so that all already existing scanner drivers could be converted to Scanner Applications and this way scanning for clients distributed in sandboxed packages (like Snap) or on all-Snap OS distributions is assured.
  • Unit tests
  • Documentation

The contributor's task to implement the above-mentioned components to complete the framework needed by all Scanner Applications. With this done, only code for the particular group of scanners to support (scanner driver) needs to be added to PAPPL.

Mentors: Till Kamppeter, Project Leader OpenPrinting (till at linux dot com), Michael Sweet, author of CUPS and PAPPL (msweet at msweet dot org), Rishabh Maheshwari (rishphalod7 at gmail dot com), Deepak Patankar (patankardeepak04 at gmail dot com)

Desired knowledge: C/C++, CUPS

Code License: Apache 2.0

Turn cups-browsed into a Printer Application

1 contributor full-size (350 hours).

cups-browsed is a helper daemon for CUPS to automatically set up network printers. In the beginning it was to overcome that when CUPS from 1.6.x on used DNS-SD instead of its own browsing/broadcasting, it did not auto-setup client queues any more.

With the time it got lots of more functionality: Legacy CUPS browsing/broadcasting for interoperability with CUPS 1.5.x and older (often in long-term support enterprise distros), clustering, manually and automatically, also for clusters of printers of completely different types, user has one “universal” print queue and by their option settings job goes to the correct printer. Also filtering lists of many printers is supported, and everything can be configured/fine-tuned by the user or admin.

With CUPS already having its temporary queue functionality for network printers without need of explicit manual setup, and the Common Print Dialog Backends getting into the print dialogs and talking to CUPS with modern interfaces, we do not need automatic queue creation for network printers any more, but the other functionality of cups-browsed is still very useful.

So we do not want to discontinue cups-browsed, but take it into the New Architecture of printing, giving it the appropriate modern interface. Currently cups-browsed discovers printers via DNS-SD, and then creates (or not creates) local print queues pointing to them according to the rules in its configuration file. But currently it creates classic CUPS queues, with PPD files generated according to the printer's IPP attributes. What we need is make it working with CUPS 3.x, which drops PPD files and classic printer drivers.

For this we want tom turn it into a Printer Application, the new printer driver format, emulating a driverless IPP printer. This way CUPS can access the printers created by cups-browsed and create temporary queues for them on-demand. Internally we define with configuration file what these queues should do: Clusters, retro-fit to old CUPS, …

The contributor's task is to implement this transition, using PAPPL for all standard elements of a Printer Application, like daemon, IPP parser, web admin interface, … They will make cups-browsed create a queue in the Printer Application if appropriate destination printers get discovered, and remove it when these printers disappear (turned off, user leaves network, …). CUPS will simply pick up on the emulated IPP printers then. And there will be a web interface to be created, for the configuration of the clusters, filter rules, …. one does not need to edit cups-browsed.conf manually any more.

Mentors: Till Kamppeter, Project Leader OpenPrinting (till at linux dot com), Deepak Patankar (patankardeepak04 at gmail dot com), TBD

Desired knowledge: C, CUPS

Code License: Apache 2.0

PAPPL-based Printer Applications: Option setting presets via web interface

1 contributor full-size (350 hours).

Generally, Printer Applications as emulation of driverless IPP printers only support standard IPP job attributes as user-settable options: media size/type/source, duplex, printer-resolution, print-quality, print-content-optimize, … but some drivers, like for example Gutenprint or also PostScript printers, have many options to fine-tune the printout and those cannot get individually mapped to IPP options so that the user can control them in a print dialog. Also many print dialogs, especially of phones, are limited to standard IPP attributes.

So what we want to add is to have a preset functionality in PAPPL. On an extra web interface page you can create and edit any number of named presets.

On this page you can create, copy, edit, and delete presets.

You see a list of the existing presets, each with buttons for copy, edit, and delete. At the top you see the create button.

If you click on the create button, you will get on the page for editing a preset.

This page contains a field for the preset's name at the top, being empty if you are creating a new preset. You enter the desired name, only with a valid name you can save your preset.

Under that you see the same options as on the “Printing Defaults” page, both the IPP standard attributes and the vendor options, but in the choices for each option is an extra one “Do not set” to not include this setting in the preset. This is chosen by default in a newly created preset. The rest of the choices are the ones which there are also under “Printing Defaults” but with the choice which is the current default under “Printing Defaults” having “ (current default)” added, to ease the orientation for the user. To define the preset, the user chooses the settings for the desired attributes/options and leaves the attributes/options they do not to include in the template on “Do not set”. If the user edits the name of the preset, it gets renamed. Then the user clicks on “Save” to save the preset. This brings them back to the list view, with the new preset in the list.

The user can for example create a “photo” preset choosing photo paper, 4×6 size, and high print quality, or a “draft” preset choosing recycled paper and draft print quality. With Gutenprint they could fine-tune a lot of knobs for each paper type, photo style, … and quickly get back to all their preferred settings by choosing the right template.

The user-defined presets are made available to the client (print dialog, or better CUPS backend of the Common Print Dialog Backends, CPDB) by the “job-presets-supported” entry in the answer to the “get-printer-attributes” IPP request and so we get an option to select a preset in the print dialogs and the client (print dialog, CPDB backend) adds the settings described in the preset to the job.

This, I think, is the best way to cope with printer drivers which have extended settings not mappable to standard IPP attributes, especially for complex drivers like Gutenprint, but also for the retro-fitting Printer Applications as the PPD files (treated by pappl-retrofit) always have non-standard options which end up as vendor options in a PAPPL-based Printer Application, not mapped to standard IPP options.

This project should be implemented in PAPPL and not in pappl-retrofit, as the problem occurs for both native (developed from scratch) and retro-fitting Printer Applications (retro-fitting a classic CUPS driver with PPD files into a Printer Application). One can easily see it when one takes the (retro-fitting) Gutenprint Printer Application. See also the screenshot of the “Printing Defaults” page in the Snap Store listing. And this will not change when we turn Gutenprint into a native Printer Application (see below).

This was already considered in the discussion during earlier work on the Gutenprint Printer Application.

For the user experience with Gutenprint this preset feature would be even more important than the switchover to a native Printer Application.

Mentors: Till Kamppeter, Project Leader OpenPrinting (till at linux dot com), Michael Sweet, author of CUPS and PAPPL (msweet at msweet dot org), TBD

Desired knowledge: C, PAPPL, CUPS

Code License: Apache 2.0

Make a native Printer Application from Gutenprint

1 contributor full-size (350 hours).

Gutenprint is a high-quality printer driver for a wide range of inkjets, especially Epson and Canon, dye-sublimation printers and even monochrome PCL laser printers. It does not only cover many printers to give them support under Linux and free software operating systems at all, but also is optimized for highest possible print quality, so that at least on some printers and with the right settings you can even get better print quality than with the original (Windows/Mac) drivers.

Gutenprint is usually used as classic CUPS driver with a CUPS filter and a PPD file generator. As, as mentioned above, CUPS will not support PPD files any more from version 3.x on and when using the CUPS Snap one cannot install PPD-based drivers already now.

So a Printer Application of Gutenprint is needed. There is already one, but it is a retro-fit of the classic CUPS driver. The Printer Application simply calls the PPD generator and the filter at the right places to do its job.

As Gutenprint contains all its printer support and printer capability info in libgutenprint or in files which are read by libgutenprint, the PPD generator and the filter only containing calls of functions in libgutenprint, it should be easy to create a PAPPL-based, native Printer Application for Gutenprint.

Here on an incoming get-printer-attributes IPP request we call the same functions which the PPD generator calls, but instead of translating the responses into a PPD file we translate it into the IPP answer for the get-printer-attributes request. And when we have a job to print, we call the library functions which the filter calls, but directly.

This does not only save us from resource-consuming calls of external executables but we are also no harnessed by the PPD file syntax and so have more flexibility in the UI representations of the (often more than 100) printer-specific options. Also, generally we should completely do away with the PPDs. Retro-fitting is only an ugly interim solution or for drivers which are not actively maintained anymore and for printers we do not have at hand and so cannot test the drivers.

The contributor's task is thus:

  • Create a PAPPL-based Printer Application using the libgutenprint library and PAPPL
  • Make sure all options and parameters of the Gutenprint driver are accessible from the Printer Application's web admin interface.
  • Package the Printer Application as a Snap

Mentors: Till Kamppeter, Project Leader OpenPrinting (till at linux dot com), Gutenprint developers TBD

Desired knowledge: C, PAPPL, CUPS

Code License: Apache 2.0

CI Testing programs for libcupsfilters, libpappl-retrofit, libppd, CPDB, ...

1 contributor full-size (350 hours).

To protect a free software project worked on by several contributors against regressions caused by a committed change, one needs frequent, automated testing of the code, base, ideally triggered by every commit into the repository. This is called Continuous Integration (CI).

What is triggered on each commit is usually some static analysis of the code using common, specialized tools and also build and execution tests, usually doing `./configure; make; make test` on different system platforms.

This naturally requires test scripts/programs which are compiled and run by the `make test` step. For CUPS for example the daemon is started (on an unprivileged port so that it does not need root), queues created and listed, jobs sent, the logs checked whether everything went OK, … For Ghostscript a large collection of input files (gathered from bug reports) is processed and converted into raster formats.

The contributor's task here is to write test programs for the different OpenPrinting projects so that `make test` does something useful, being efficient to catch regressions. They should exercise important functionality of the software with different parameters and analyse logs and output files to check whether the program did the expected work.

Test programs are also needed for the so-called 'autopkgtest' tests which are added to Debian packages and executed whenever the package is uploaded to Debian or Ubuntu.

In addition, instruction files and shell scripts are needed to build the software on different platforms/environments, run tests, create GitHub Actions (for the automatic triggering on each commit …).

This subject got discussed on the OpenPrinting micro-conference on Linux Plumbers 2022: (Summary, Slides, Video)

Here you can see what we already have in terms of CI, and what is missing …

Mentors: Till Kamppeter, Project Leader OpenPrinting (till at linux dot com), Michael Sweet, author of CUPS and PAPPL (msweet at msweet dot org), TBD

Desired knowledge: C, Shell, PAPPL, CUPS, CI

Code License: Apache 2.0, MIT

GNOME Control Center: List and handle IPP print services for the New Architecture

1 contributor full-size (350 hours).

Modern printers usually are driverless IPP printers, and those get discovered fully automatically by CUPS, no CUPS queue needs to get explicitly created. Same for remote CUPS printers and also Printer Applications (new format for drivers for non-driverless specialty and legacy printers). They get all discovered as IPP print services.

This means that a printer setup tool does not need to display CUPS queues any more, but instead, IPP print services, each of them being a possible destination for print jobs.

And listings of IPP print services have different requirements: One server can have more than one individual print services and these should get listed together. This could be a print queue and a fax out queue of the same multi-function printer, or two physical legacy printers supported by one Printer Application. Also the user interaction coupled to each listing is different. We do not need to configure PPD option settings, but instead, we need access to the IPP service's web administration interface and also to an IPP System Service configuration panel by a simple mouse click.

Several parts of this got already coded in previous GSoCs, but we need to get everything smoothly integrated in the “Printers” part of the GNOME Control Center, and this is the contributors task here. They will work together with the upstream maintainer of the “Printers” module, Marek Kasik and also with the UI/UX design teams of GNOME and of Canonical.

Mentors: Till Kamppeter, Project Leader OpenPrinting (till at linux dot com), Mare Kasik (mkasik at redhat dot com), further GNOME/GTK developers TBD

Desired knowledge: C/C++, GTK, DNS-SD/Avahi, CUPS/IPP

Code License: GPL-2+ and LGPL-2+

cups-filters: Create OCR filter to deliver scans as searchable PDFs

1 contributor half-size (175 hrs)

Scanning with IPP Scan gives the user the possibility to request the scanned image in PDF format. If the IPP Scan server is a Scanner Application, a filter function from cups-filters would convert the the raster image coming from the scanner into PDF.

Now such PDF files are simply raster images in a PDF frame, not high-level graphics with text and fonts, as PDFs produced by office applications are. Especially one cannot search text in a PDF coming from a scanning process.

Ghostscript has a new “pdfocr8” device with which Ghostscript takes raster graphics PDFs (or PostScript files) as input, applies OCR (Optical Character Recognition) to the raster image, and creates a PDF which contains the raster image to visually show the scan but adds data about the contained text and where it is located, so that you can find text with the search facility of a PDF viewer.

Here the contributor's task is to write a filter function (or extend the ghostscript() filter function) to make the “pdfocr8” output device of Ghostscript being used so that a searchable PDF is obtained.

Mentors: Till Kamppeter, Project Leader OpenPrinting (till at linux dot com), Sahil Arora (sahilarora dot 535 at gmail dot com), Dheeraj Yadav (dhirajyadav135 at gmail dot com), TBD

Desired knowledge: C/C++, CUPS

Code License: Apache 2.0

gsoc/google-summer-code-2023-openprinting-projects.txt · Last modified: 2023/01/19 14:44 by till