Printer
Superclasses: Object
- Constructors:
Printer(**properties)
new(name:str, backend:Gtk.PrintBackend, virtual_:bool) -> Gtk.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
Signals
- class Printer.signals