gtk.unixprint.PrintJob — an object that represents a print job (new in PyGTK 2.10)
class gtk.unixprint.PrintJob(gobject.GObject): |
|
gobject.GObject Signal Prototypes
"status-changed" | def callback(printjob, user_param1, ...) |
This class is available in PyGTK 2.10 and above.
A gtk.PrintJob 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 gtk.PrintUnixDialog API.
Use the get_surface() method to obtain the cairo surface onto which the pages must be drawn. Use the send() method to send the finished job to the printer. If you don't use cairo gtk.PrintJob also supports printing of manually generated postscript, via the set_source_file() method.
|
title : | the job title |
printer : | a gtk.unixprint.Printer |
settings : | a gtk.PrintSettings |
page_setup : | a gtk.PageSetup |
Returns : | a new gtk.unixprint.PrintJob |
This constructor is available in PyGTK 2.10 and above.
Creates a new gtk.unixprint.PrintJob.
|
Returns : | the settings of the print job |
This method is available in PyGTK 2.10 and above.
The get_settings() method returns the gtk.PrintSettings of the print job.
|
Returns : | the printer of the print job |
This method is available in PyGTK 2.10 and above.
The get_printer() method returns the gtk.unixprint.Printer of the print job.
|
Returns : | the title of the print job |
This method is available in PyGTK 2.10 and above.
The get_title() method returns the print job title.
|
Returns : | the status of the print job |
This method is available in PyGTK 2.10 and above.
The get_status() method returns the status of the print job.
|
filename : | the file to be printed |
Returns : | FALSE if an error occurred |
This method is available in PyGTK 2.10 and above.
The set_source_file() method makes the gtk.unixprint.PrintJob send the existing document specified by filename 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).
|
Returns : | the cairo surface of the print job |
This method is available in PyGTK 2.10 and above.
The get_surface() method returns a cairo surface onto which the pages of the print job should be rendered.
|
track_status : | if TRUE track the status of the print job after sending |
This method is available in PyGTK 2.10 and above.
The set_track_print_status() method enable or disables tracking of the print job status based on the value specified by track_status. 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 method is often implemented using some form of polling, so tracking should not be enabled unless needed.
|
Returns : | TRUE if print job status will be reported after printing |
This method is available in PyGTK 2.10 and above.
The get_track_print_status() method returns wheter jobs will be tracked after printing. For details, see the set_track_print_status() method.
|
callback : | the function to call when the job completes |
user_data : | user data that gets passed to callback |
Returns : | FALSE if an error occurred |
This method is available in PyGTK 2.10 and above.
The send() method sends the print job off to the printer and registers the function specified by callback ro be called when the job completes.
The signature of callback is:
def callback(print_job, data, errormsg): |
where data is user_data and errormsg is a message indicating what problem has occurred or None if no error has occurred.
|
gtkprintjob : | the gtkprintjob that received the signal |
user_param1 : | the first user parameter (if any) specified with the connect() method |
... : | additional user parameters (if any) |
The "status-changed" signal is emitted when the status of a job changes. The signal handler can use the get_status() method to obtain the new status.