Printer#
Superclasses: Object
A GtkPrinter
object represents a printer.
You only need to deal directly with printers if you use the
non-portable PrintUnixDialog
API.
A GtkPrinter
allows to get status information about the printer,
such as its description, its location, the number of queued jobs,
etc. Most importantly, a GtkPrinter
object can be used to create
a PrintJob
object, which lets you print to the printer.
Constructors#
- class Printer
- classmethod new(name: str, backend: PrintBackend, virtual_: bool) Printer #
Creates a new
GtkPrinter
.- Parameters:
name – the name of the printer
backend – a
GtkPrintBackend
virtual – whether the printer is virtual
Methods#
- class Printer
-
- get_backend() PrintBackend #
Returns the backend of the printer.
- get_capabilities() PrintCapabilities #
Returns the printer’s capabilities.
This is useful when you’re using
GtkPrintUnixDialog
’s manual-capabilities setting and need to know which settings the printer can handle and which you must handle yourself.This will return 0 unless the printer’s details are available, see
has_details
andrequest_details
.
- get_hard_margins() Tuple[bool, float, float, float, float] #
Retrieve the hard margins of
printer
.These are the margins that define the area at the borders of the paper that the printer cannot print to.
Note: This will not succeed unless the printer’s details are available, see
has_details
andrequest_details
.
- get_hard_margins_for_paper_size(paper_size: PaperSize) Tuple[bool, float, float, float, float] #
Retrieve the hard margins of
printer
forpaper_size
.These are the margins that define the area at the borders of the paper that the printer cannot print to.
Note: This will not succeed unless the printer’s details are available, see
has_details
andrequest_details
.- Parameters:
paper_size – a
GtkPaperSize
- is_paused() bool #
Returns whether the printer is currently paused.
A paused printer still accepts jobs, but it is not printing them.
- is_virtual() bool #
Returns whether the printer is virtual (i.e. does not represent actual printer hardware, but something like a CUPS class).
- list_papers() list[PageSetup] #
Lists all the paper sizes
printer
supports.This will return and empty list unless the printer’s details are available, see
has_details
andrequest_details
.
- request_details() None #
Requests the printer details.
When the details are available, the
details_acquired
signal will be emitted onprinter
.
Properties#
- class Printer