PrintJob#
Superclasses: Object
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 PrintUnixDialog
API.
Use get_surface
to obtain the cairo surface
onto which the pages must be drawn. Use send
to send the finished job to the printer. If you don’t use cairo
GtkPrintJob
also supports printing of manually generated PostScript,
via set_source_file
.
Constructors#
Methods#
- class PrintJob
-
- get_n_up_layout() NumberUpLayout #
Gets the n-up layout setting for this job.
- get_pages() PrintPages #
Gets the
GtkPrintPages
setting for this job.
- get_settings() PrintSettings #
Gets the
GtkPrintSettings
of the print job.
- get_status() PrintStatus #
Gets the status of the print job.
- get_surface() Surface #
Gets a cairo surface onto which the pages of the print job should be rendered.
- get_track_print_status() bool #
Returns whether jobs will be tracked after printing.
For details, see
set_track_print_status
.
- send(callback: Callable[[...], None], *user_data: Any) None #
Sends the print job off to the printer.
- Parameters:
callback – function to call when the job completes or an error occurs
user_data – user data that gets passed to
callback
- set_collate(collate: bool) None #
Sets whether this job is printed collated.
- Parameters:
collate – whether the job is printed collated
- set_n_up_layout(layout: NumberUpLayout) None #
Sets the n-up layout setting for this job.
- Parameters:
layout – the n-up layout setting
- set_num_copies(num_copies: int) None #
Sets the number of copies for this job.
- Parameters:
num_copies – the number of copies
- set_page_ranges(ranges: Sequence[PageRange]) None #
Sets the page ranges for this job.
- Parameters:
ranges – pointer to an array of
GtkPageRange
structs
- set_page_set(page_set: PageSet) None #
Sets the
GtkPageSet
setting for this job.- Parameters:
page_set – a
GtkPageSet
setting
- set_pages(pages: PrintPages) None #
Sets the
GtkPrintPages
setting for this job.- Parameters:
pages – the
GtkPrintPages
setting
- set_reverse(reverse: bool) None #
Sets whether this job is printed reversed.
- Parameters:
reverse – whether the job is printed reversed
- set_rotate(rotate: bool) None #
Sets whether this job is printed rotated.
- Parameters:
rotate – whether to print rotated
- set_scale(scale: float) None #
Sets the scale for this job.
1.0 means unscaled.
- Parameters:
scale – the scale
- set_source_fd(fd: int) bool #
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
accepts_pdf
andaccepts_ps
.This is similar to
set_source_file
, but takes expects an open file descriptor for the file, instead of a filename.- Parameters:
fd – a file descriptor
- set_source_file(filename: str) bool #
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
accepts_pdf
andaccepts_ps
.- Parameters:
filename – the file to be printed
- set_track_print_status(track_status: bool) None #
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.
- Parameters:
track_status –
True
to track status after printing
Properties#
- class PrintJob
-
- props.settings: PrintSettings#
The type of the None singleton.