Gtk.PrintJob¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r/w |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the status of a job changes. |
Fields¶
- Inherited:
Class Details¶
- class Gtk.PrintJob(**kwargs)¶
- Bases:
- Abstract:
No
A
GtkPrintJob
object represents a job that is sent to a printer.You only need to deal directly with print jobs if you use the non-portable [class`Gtk`.PrintUnixDialog] API.
Use [method`Gtk`.PrintJob.get_surface] to obtain the cairo surface onto which the pages must be drawn. Use [method`Gtk`.PrintJob.send] to send the finished job to the printer. If you don’t use cairo
GtkPrintJob
also supports printing of manually generated PostScript, via [method`Gtk`.PrintJob.set_source_file].- classmethod new(title, printer, settings, page_setup)[source]¶
- Parameters:
title (
str
) – the job titleprinter (
Gtk.Printer
) – aGtkPrinter
settings (
Gtk.PrintSettings
) – aGtkPrintSettings
page_setup (
Gtk.PageSetup
) – aGtkPageSetup
- Returns:
a new
GtkPrintJob
- Return type:
Creates a new
GtkPrintJob
.
- get_collate()[source]¶
- Returns:
whether the job is printed collated
- Return type:
Gets whether this job is printed collated.
- get_n_up_layout()[source]¶
- Returns:
the n-up layout
- Return type:
Gets the n-up layout setting for this job.
- get_num_copies()[source]¶
- Returns:
the number of copies
- Return type:
Gets the number of copies of this job.
- get_page_ranges()[source]¶
- Returns:
a pointer to an array of
GtkPageRange
structs- Return type:
Gets the page ranges for this job.
- get_page_set()[source]¶
- Returns:
the
GtkPageSet
setting- Return type:
Gets the
GtkPageSet
setting for this job.
- get_pages()[source]¶
- Returns:
the
GtkPrintPages
setting- Return type:
Gets the
GtkPrintPages
setting for this job.
- get_printer()[source]¶
- Returns:
the printer of self
- Return type:
Gets the
GtkPrinter
of the print job.
- get_reverse()[source]¶
- Returns:
whether the job is printed reversed.
- Return type:
Gets whether this job is printed reversed.
- get_rotate()[source]¶
- Returns:
whether the job is printed rotated
- Return type:
Gets whether the job is printed rotated.
- get_settings()[source]¶
- Returns:
the settings of self
- Return type:
Gets the
GtkPrintSettings
of the print job.
- get_surface()[source]¶
- Raises:
- Returns:
the cairo surface of self
- Return type:
Gets a cairo surface onto which the pages of the print job should be rendered.
- get_track_print_status()[source]¶
-
Returns whether jobs will be tracked after printing.
For details, see [method`Gtk`.PrintJob.set_track_print_status].
- send(callback, *user_data)[source]¶
- Parameters:
callback (
Gtk.PrintJobCompleteFunc
) – function to call when the job completes or an error occursuser_data (
object
orNone
) – user data that gets passed to callback
Sends the print job off to the printer.
- set_collate(collate)[source]¶
- Parameters:
collate (
bool
) – whether the job is printed collated
Sets whether this job is printed collated.
- set_n_up_layout(layout)[source]¶
- Parameters:
layout (
Gtk.NumberUpLayout
) – the n-up layout setting
Sets the n-up layout setting for this job.
- set_num_copies(num_copies)[source]¶
- Parameters:
num_copies (
int
) – the number of copies
Sets the number of copies for this job.
- set_page_ranges(ranges)[source]¶
- Parameters:
ranges ([
Gtk.PageRange
]) – pointer to an array ofGtkPageRange
structs
Sets the page ranges for this job.
- set_page_set(page_set)[source]¶
- Parameters:
page_set (
Gtk.PageSet
) – aGtkPageSet
setting
Sets the
GtkPageSet
setting for this job.
- set_pages(pages)[source]¶
- Parameters:
pages (
Gtk.PrintPages
) – theGtkPrintPages
setting
Sets the
GtkPrintPages
setting for this job.
- set_reverse(reverse)[source]¶
- Parameters:
reverse (
bool
) – whether the job is printed reversed
Sets whether this job is printed reversed.
- set_rotate(rotate)[source]¶
- Parameters:
rotate (
bool
) – whether to print rotated
Sets whether this job is printed rotated.
- set_scale(scale)[source]¶
- Parameters:
scale (
float
) – the scale
Sets the scale for this job.
1.0 means unscaled.
- set_source_fd(fd)[source]¶
-
Make the
GtkPrintJob
send an existing document to the printing system.The file can be in any format understood by the platforms printing system (typically PostScript, but on many platforms PDF may work too). See [method`Gtk`.Printer.accepts_pdf] and [method`Gtk`.Printer.accepts_ps].
This is similar to [method`Gtk`.PrintJob.set_source_file], but takes expects an open file descriptor for the file, instead of a filename.
- set_source_file(filename)[source]¶
- Parameters:
filename (
str
) – the file to be printed- Raises:
- Returns:
False
if an error occurred- Return type:
Make the
GtkPrintJob
send an existing document to the printing system.The file can be in any format understood by the platforms printing system (typically PostScript, but on many platforms PDF may work too). See [method`Gtk`.Printer.accepts_pdf] and [method`Gtk`.Printer.accepts_ps].
- set_track_print_status(track_status)[source]¶
-
If track_status is
True
, the print job will try to continue report on the status of the print job in the printer queues and printer.This can allow your application to show things like “out of paper” issues, and when the print job actually reaches the printer.
This function is often implemented using some form of polling, so it should not be enabled unless needed.
Signal Details¶
- Gtk.PrintJob.signals.status_changed(print_job)¶
- Signal Name:
status-changed
- Flags:
- Parameters:
print_job (
Gtk.PrintJob
) – The object which received the signal
Emitted when the status of a job changes.
The signal handler can use [method`Gtk`.PrintJob.get_status] to obtain the new status.
Property Details¶
- Gtk.PrintJob.props.page_setup¶
- Name:
page-setup
- Type:
- Default Value:
- Flags:
Page setup.
- Gtk.PrintJob.props.printer¶
- Name:
printer
- Type:
- Default Value:
- Flags:
The printer to send the job to.
- Gtk.PrintJob.props.settings¶
- Name:
settings
- Type:
- Default Value:
- Flags:
Printer settings.
- Gtk.PrintJob.props.title¶
- Name:
title
- Type:
- Default Value:
- Flags:
The title of the print job.