Gtk.Printer¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
|||
r/w/co |
|||
r/w/co |
|||
r |
|||
r/w/co |
|||
r |
|||
r |
|||
r/w/co |
|||
r |
|||
r |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted in response to a request for detailed information about a printer from the print backend. |
Fields¶
- Inherited:
Class Details¶
- class Gtk.Printer(**kwargs)¶
- Bases:
- Abstract:
No
A
GtkPrinter
object represents a printer.You only need to deal directly with printers if you use the non-portable [class`Gtk`.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, aGtkPrinter
object can be used to create a [class`Gtk`.PrintJob] object, which lets you print to the printer.- classmethod new(name, backend, virtual_)[source]¶
- Parameters:
name (
str
) – the name of the printerbackend (
Gtk.PrintBackend
) – aGtkPrintBackend
virtual (
bool
) – whether the printer is virtual
- Returns:
a new
GtkPrinter
- Return type:
Creates a new
GtkPrinter
.
- compare(b)[source]¶
- Parameters:
b (
Gtk.Printer
) – anotherGtkPrinter
- Returns:
0 if the printer match, a negative value if self < b, or a positive value if self > b
- Return type:
Compares two printers.
- get_backend()[source]¶
- Returns:
the backend of self
- Return type:
Returns the backend of the printer.
- get_capabilities()[source]¶
- Returns:
the printer’s capabilities
- Return type:
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 [method`Gtk`.Printer.has_details] and [method`Gtk`.Printer.request_details].
- get_default_page_size()[source]¶
- Returns:
a newly allocated
GtkPageSetup
with default page size of the printer.- Return type:
Returns default page size of self.
- get_description()[source]¶
- Returns:
the description of self
- Return type:
Gets the description of the printer.
- get_hard_margins()[source]¶
- Returns:
True
iff the hard margins were retrieved- top:
a location to store the top margin in
- bottom:
a location to store the bottom margin in
- left:
a location to store the left margin in
- right:
a location to store the right margin in
- Return type:
(
bool
, top:float
, bottom:float
, left:float
, right:float
)
Retrieve the hard margins of self.
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 [method`Gtk`.Printer.has_details] and [method`Gtk`.Printer.request_details].
- get_hard_margins_for_paper_size(paper_size)[source]¶
- Parameters:
paper_size (
Gtk.PaperSize
) – aGtkPaperSize
- Returns:
True
iff the hard margins were retrieved- top:
a location to store the top margin in
- bottom:
a location to store the bottom margin in
- left:
a location to store the left margin in
- right:
a location to store the right margin in
- Return type:
(
bool
, top:float
, bottom:float
, left:float
, right:float
)
Retrieve the hard margins of self for paper_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 [method`Gtk`.Printer.has_details] and [method`Gtk`.Printer.request_details].
- get_icon_name()[source]¶
- Returns:
the icon name for self
- Return type:
Gets the name of the icon to use for the printer.
- get_job_count()[source]¶
- Returns:
the number of jobs on self
- Return type:
Gets the number of jobs currently queued on the printer.
- get_location()[source]¶
- Returns:
the location of self
- Return type:
Returns a description of the location of the printer.
- get_state_message()[source]¶
- Returns:
the state message of self
- Return type:
Returns the state message describing the current state of the printer.
- is_paused()[source]¶
-
Returns whether the printer is currently paused.
A paused printer still accepts jobs, but it is not printing them.
- is_virtual()[source]¶
-
Returns whether the printer is virtual (i.e. does not represent actual printer hardware, but something like a CUPS class).
- list_papers()[source]¶
- Returns:
a newly allocated list of newly allocated ``GtkPageSetup``s.
- Return type:
Lists all the paper sizes self supports.
This will return and empty list unless the printer’s details are available, see [method`Gtk`.Printer.has_details] and [method`Gtk`.Printer.request_details].
Signal Details¶
- Gtk.Printer.signals.details_acquired(printer, success)¶
- Signal Name:
details-acquired
- Flags:
- Parameters:
printer (
Gtk.Printer
) – The object which received the signalsuccess (
bool
) –True
if the details were successfully acquired
Emitted in response to a request for detailed information about a printer from the print backend.
The success parameter indicates if the information was actually obtained.
Property Details¶
- Gtk.Printer.props.accepts_pdf¶
- Name:
accepts-pdf
- Type:
- Default Value:
- Flags:
True
if this printer can accept PDF.
- Gtk.Printer.props.accepts_ps¶
- Name:
accepts-ps
- Type:
- Default Value:
- Flags:
True
if this printer can accept PostScript.
- Gtk.Printer.props.icon_name¶
-
Icon name to use for the printer.
- Gtk.Printer.props.is_virtual¶
- Name:
is-virtual
- Type:
- Default Value:
- Flags:
False
if this represents a real hardware device.
- Gtk.Printer.props.job_count¶
-
Number of jobs queued in the printer.
- Gtk.Printer.props.location¶
-
Information about the location of the printer.
- Gtk.Printer.props.name¶
- Name:
name
- Type:
- Default Value:
''
- Flags:
The name of the printer.