| Top |
| CtkPageSetup * | page-setup | Read / Write / Construct Only |
| CtkPrinter * | printer | Read / Write / Construct Only |
| CtkPrintSettings * | settings | Read / Write / Construct Only |
| char * | title | Read / Write / Construct Only |
| gboolean | track-print-status | Read / Write |
A CtkPrintJob 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 CtkPrintUnixDialog API.
Use ctk_print_job_get_surface() to obtain the cairo surface
onto which the pages must be drawn. Use ctk_print_job_send()
to send the finished job to the printer. If you don’t use cairo
CtkPrintJob also supports printing of manually generated postscript,
via ctk_print_job_set_source_file().
void (*CtkPrintJobCompleteFunc) (CtkPrintJob *print_job,gpointer user_data,const GError *error);
The type of callback that is passed to ctk_print_job_send().
It is called when the print job has been completely sent.
print_job |
the CtkPrintJob |
|
user_data |
user data that has been passed to |
|
error |
a GError that contains error information if the sending
of the print job failed, otherwise |
CtkPrintJob * ctk_print_job_new (const gchar *title,CtkPrinter *printer,CtkPrintSettings *settings,CtkPageSetup *page_setup);
Creates a new CtkPrintJob.
Since: 2.10
CtkPrintSettings *
ctk_print_job_get_settings (CtkPrintJob *job);
Gets the CtkPrintSettings of the print job.
Since: 2.10
CtkPrinter *
ctk_print_job_get_printer (CtkPrintJob *job);
Gets the CtkPrinter of the print job.
Since: 2.10
const gchar *
ctk_print_job_get_title (CtkPrintJob *job);
Gets the job title.
Since: 2.10
CtkPrintStatus
ctk_print_job_get_status (CtkPrintJob *job);
Gets the status of the print job.
Since: 2.10
gboolean ctk_print_job_set_source_fd (CtkPrintJob *job,int fd,GError **error);
Make the CtkPrintJob 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
ctk_printer_accepts_pdf() and ctk_printer_accepts_ps().
This is similar to ctk_print_job_set_source_file(),
but takes expects an open file descriptor for the file,
instead of a filename.
Since: 3.22
gboolean ctk_print_job_set_source_file (CtkPrintJob *job,const gchar *filename,GError **error);
Make the CtkPrintJob 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
ctk_printer_accepts_pdf() and ctk_printer_accepts_ps().
Since: 2.10
cairo_surface_t * ctk_print_job_get_surface (CtkPrintJob *job,GError **error);
Gets a cairo surface onto which the pages of the print job should be rendered.
Since: 2.10
void ctk_print_job_send (CtkPrintJob *job,CtkPrintJobCompleteFunc callback,gpointer user_data,GDestroyNotify dnotify);
Sends the print job off to the printer.
job |
a CtkPrintJob |
|
callback |
function to call when the job completes or an error occurs |
|
user_data |
user data that gets passed to |
|
dnotify |
destroy notify for |
Since: 2.10
void ctk_print_job_set_track_print_status (CtkPrintJob *job,gboolean 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 function is often implemented using some form of polling, so it should not be enabled unless needed.
Since: 2.10
gboolean
ctk_print_job_get_track_print_status (CtkPrintJob *job);
Returns wheter jobs will be tracked after printing.
For details, see ctk_print_job_set_track_print_status().
Since: 2.10
CtkPrintPages
ctk_print_job_get_pages (CtkPrintJob *job);
Gets the CtkPrintPages setting for this job.
Since: 3.0
void ctk_print_job_set_pages (CtkPrintJob *job,CtkPrintPages pages);
Sets the CtkPrintPages setting for this job.
Since: 3.0
CtkPageRange * ctk_print_job_get_page_ranges (CtkPrintJob *job,gint *n_ranges);
Gets the page ranges for this job.
Since: 3.0
void ctk_print_job_set_page_ranges (CtkPrintJob *job,CtkPageRange *ranges,gint n_ranges);
Sets the page ranges for this job.
job |
||
ranges |
pointer to an array of CtkPageRange structs. |
[array length=n_ranges][transfer full] |
n_ranges |
the length of the |
Since: 3.0
CtkPageSet
ctk_print_job_get_page_set (CtkPrintJob *job);
Gets the CtkPageSet setting for this job.
Since: 3.0
void ctk_print_job_set_page_set (CtkPrintJob *job,CtkPageSet page_set);
Sets the CtkPageSet setting for this job.
Since: 3.0
gint
ctk_print_job_get_num_copies (CtkPrintJob *job);
Gets the number of copies of this job.
Since: 3.0
void ctk_print_job_set_num_copies (CtkPrintJob *job,gint num_copies);
Sets the number of copies for this job.
Since: 3.0
gdouble
ctk_print_job_get_scale (CtkPrintJob *job);
Gets the scale for this job (where 1.0 means unscaled).
Since: 3.0
void ctk_print_job_set_scale (CtkPrintJob *job,gdouble scale);
Sets the scale for this job (where 1.0 means unscaled).
Since: 3.0
guint
ctk_print_job_get_n_up (CtkPrintJob *job);
Gets the n-up setting for this job.
Since: 3.0
void ctk_print_job_set_n_up (CtkPrintJob *job,guint n_up);
Sets the n-up setting for this job.
Since: 3.0
CtkNumberUpLayout
ctk_print_job_get_n_up_layout (CtkPrintJob *job);
Gets the n-up layout setting for this job.
Since: 3.0
void ctk_print_job_set_n_up_layout (CtkPrintJob *job,CtkNumberUpLayout layout);
Sets the n-up layout setting for this job.
Since: 3.0
gboolean
ctk_print_job_get_rotate (CtkPrintJob *job);
Gets whether the job is printed rotated.
Since: 3.0
void ctk_print_job_set_rotate (CtkPrintJob *job,gboolean rotate);
Sets whether this job is printed rotated.
Since: 3.0
gboolean
ctk_print_job_get_collate (CtkPrintJob *job);
Gets whether this job is printed collated.
Since: 3.0
void ctk_print_job_set_collate (CtkPrintJob *job,gboolean collate);
Sets whether this job is printed collated.
Since: 3.0
gboolean
ctk_print_job_get_reverse (CtkPrintJob *job);
Gets whether this job is printed reversed.
Since: 3.0
void ctk_print_job_set_reverse (CtkPrintJob *job,gboolean reverse);
Sets whether this job is printed reversed.
Since: 3.0
“page-setup” property“page-setup” CtkPageSetup *
Page Setup.
Owner: CtkPrintJob
Flags: Read / Write / Construct Only
“printer” property“printer” CtkPrinter *
Printer to print the job to.
Owner: CtkPrintJob
Flags: Read / Write / Construct Only
“settings” property“settings” CtkPrintSettings *
Printer settings.
Owner: CtkPrintJob
Flags: Read / Write / Construct Only
“title” property “title” char *
Title of the print job.
Owner: CtkPrintJob
Flags: Read / Write / Construct Only
Default value: NULL
“status-changed” signalvoid user_function (CtkPrintJob *job, gpointer user_data)
Gets emitted when the status of a job changes. The signal handler
can use ctk_print_job_get_status() to obtain the new status.
job |
the CtkPrintJob object on which the signal was emitted |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.10