Skip to content

New CPDB print backend for GTK Print Dialog

TinyTrebuchet requested to merge TinyTrebuchet/gtk:cpdb into main

Print Dialogs are one of the most used features for many people, and it is important that they stay up to date with the current print technologies (like CUPS) and be able to quickly adopt any new such upcoming technology (XYZ Cloud Printing Service). The print technology developers should also be able to fix any bugs as soon as they are found. However, since most Print Dialogs are provided natively by the GUI toolkits (and in some cases applications like LibreOffice and Chrome), this is often not the case. This is because the GUI toolkits themselves are large projects with long release cycles, and they have a lot of other similarly important things to work on.

As of current, most GUI toolkits like GTK and QT connect their Print Dialogs directly with the print technologies (as shown in Figure 1) like CUPS which creates problems for both. Any changes made by the print technologies, be it a bug fix or a new feature release often takes a long time to show up in the print dialogs upstream due to the reason mentioned before. Similarly, the print technologies need to constantly maintain backwards compatibility since they can’t release breaking changes if the Print Dialogs have not yet implemented them. Besides this, there is also a disconnect between the two sides due to the slow-release cycles.


The Common Print Dialog Backends (CPDB) introduced in 2017 by Till Kamppeter aims to de-couple the GUI from the print technologies. Instead of directly connecting to each print technologies separately, the GUI projects only must adopt CPDB support once, and then OpenPrinting (or any upcoming cloud printing projects) takes care of the CPD Backend for the print technologies to be up to date with any changes (as shown in Figure 2). This way print technologies can react quickly and not be bound by the big GUI toolkits’ inertia.


I have been working on adding CPDB support to the GTK print dialog as a part of my GSoC project this summer, under the mentorship of Till Kamppeter. This merge request adds a new GtkPrintBackend for CPDB just like one exists for CUPS. One needs to install the cpdb-libs and cpdb-backend-cups (and optionally cpdb-backend-file) libraries to be able to compile and test the GTK Print Dialog backend. Once they have been installed, gtk can be built and installed from source normally, and the Print Dialog will use the CPDB backend instead of the original CUPS backend.

This is my first time contributing to GTK (or working on any big project in general). If anything needs to be added, removed or changed, kindly let me know, I'd be happy to address it. 😄

Merge request reports