The PrintOperation object is a key part of the printing functionality of GTK+, and connects to each of the other printing functionality such as the dialogs, settings, and page setup details.


The PrintOperation is constructed via:

printoperation = Gtk.PrintOperation()


The job name is settable using:


A job name is useful for the end user to identify the document being printed. If no job name is specified, GTK+ picks a default one based on numbering of successive jobs.

The printing functionality supports exporting the print job to file (e.g. PDF) rather than an actual device. The default filename of the exported document can be set with:


The units used by the print job for sizing purposes can be set with:


The unit parameter should be set to one of the following:

  • Gtk.Unit.NONE
  • Gtk.Unit.POINTS
  • Gtk.Unit.INCH
  • Gtk.Unit.MM

The print settings associated with the job can be attached by calling:


The settings parameter should be set to the PrintSettings object for the job, which contains information such as paper size and orientation, whether to use colour, or the number of copies.

To configure whether the progress of the print job is shown, use:


When show_progress is set to True, a progress bar will be shown within a dialog.

Displaying status messages on the state of the printer can be important in some cases. The status can be tracked via:


When track_status is set to True, the status of the job queue may be reported back. For instance, this could be used to display “Out of paper”.