1.154 <GtkPrintJob>

Class: <GtkPrintJob>

It derives from <GObject>.

Represents a job that is sent to a printer.

You only need to deal directly with print jobs if you use the non-portable <GtkPrintUnixDialog> API.

Use print-job:get-surface to obtain the cairo surface onto which the pages must be drawn. Use print-job:send to send the finished job to the printer. If you don’t use cairo <GtkPrintJob> also supports printing of manually generated PostScript, via print-job:set-source-file?.

Properties

Property: print-job:page-setup self

Page setup.

Its value is a <GtkPageSetup>, or #f.

It can only be set when the object is made, with #:page-setup.

Property: print-job:printer self

The printer to send the job to.

Its value is a <GtkPrinter>, or #f.

It can only be set when the object is made, with #:printer.

Property: print-job:settings self

Printer settings.

Its value is a <GtkPrintSettings>, or #f.

It can only be set when the object is made, with #:settings.

Property: print-job:title self

The title of the print job.

Its value is a string, or #f.

It can only be set when the object is made, with #:title.

Property: print-job:track-print-status self

#t if the print job will continue to emit status-changed signals after the print data has been setn to the printer.

Its value is a boolean.

Set it with (set! (print-job:track-print-status self) value).

Procedures

Method: print-job:get-collate? self ⇒ %return
Method: get-collate? self ⇒ %return

Gets whether this job is printed collated.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a boolean.

whether the job is printed collated

Method: print-job:get-n-up self ⇒ %return
Method: get-n-up self ⇒ %return

Gets the n-up setting for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: an unsigned 32-bit integer.

the n-up setting

Method: print-job:get-n-up-layout self ⇒ %return
Method: get-n-up-layout self ⇒ %return

Gets the n-up layout setting for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a <GtkNumberUpLayout>.

the n-up layout

Method: print-job:get-num-copies self ⇒ %return
Method: get-num-copies self ⇒ %return

Gets the number of copies of this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a 32-bit integer.

the number of copies

Method: print-job:get-page-ranges self ⇒ %return
Method: get-page-ranges self ⇒ %return

Gets the page ranges for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a vector, each a <GtkPageRange>.

a pointer to an array of <GtkPageRange> structs

n-ranges

Not returned: it is the length of %return.

return location for the number of ranges

Method: print-job:get-page-set self ⇒ %return
Method: get-page-set self ⇒ %return

Gets the <GtkPageSet> setting for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a <GtkPageSet>.

the <GtkPageSet> setting

Method: print-job:get-pages self ⇒ %return
Method: get-pages self ⇒ %return

Gets the <GtkPrintPages> setting for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a <GtkPrintPages>.

the <GtkPrintPages> setting

Method: print-job:get-printer self ⇒ %return
Method: get-printer self ⇒ %return

Gets the <GtkPrinter> of the print job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a <GtkPrinter>.

the printer of self

Method: print-job:get-reverse? self ⇒ %return
Method: get-reverse? self ⇒ %return

Gets whether this job is printed reversed.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a boolean.

whether the job is printed reversed.

Method: print-job:get-rotate? self ⇒ %return
Method: get-rotate? self ⇒ %return

Gets whether the job is printed rotated.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a boolean.

whether the job is printed rotated

Method: print-job:get-scale self ⇒ %return
Method: get-scale self ⇒ %return

Gets the scale for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a real number.

the scale

Method: print-job:get-settings self ⇒ %return
Method: get-settings self ⇒ %return

Gets the <GtkPrintSettings> of the print job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a <GtkPrintSettings>.

the settings of self

Method: print-job:get-status self ⇒ %return
Method: get-status self ⇒ %return

Gets the status of the print job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a <GtkPrintStatus>.

the status of self

Method: print-job:get-surface self ⇒ %return
Method: get-surface self ⇒ %return

Gets a cairo surface onto which the pages of the print job should be rendered.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a <CairoSurface>.

the cairo surface of self

Method: print-job:get-title self ⇒ %return
Method: get-title self ⇒ %return

Gets the job title.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a string.

the title of self

Method: print-job:get-track-print-status? self ⇒ %return
Method: get-track-print-status? self ⇒ %return

Returns whether jobs will be tracked after printing.

For details, see print-job:set-track-print-status.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

%return

Returned: a boolean.

#t if print job status will be reported after printing

Procedure: print-job:new title printer settings page-setup ⇒ %return

Creates a new <GtkPrintJob>.

title

Passed: a string.

the job title

printer

Passed: a <GtkPrinter>.

a <GtkPrinter>

settings

Passed: a <GtkPrintSettings>.

a <GtkPrintSettings>

page-setup

Passed: a <GtkPageSetup>.

a <GtkPageSetup>

%return

Returned: a <GtkPrintJob>.

a new <GtkPrintJob>

Method: print-job:send self callback
Method: send self callback

Sends the print job off to the printer.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

callback

Passed: a procedure.

function to call when the job completes or an error occurs

See GtkPrintJobCompleteFunc for how it is called.

user-data

Not passed: guile-gi supplies it.

user data that gets passed to callback

dnotify

Not passed: guile-gi supplies it.

destroy notify for user-data

See GDestroyNotify for how it is called.

Method: print-job:set-collate self collate
Method: set-collate self collate

Sets whether this job is printed collated.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

collate

Passed: a boolean.

whether the job is printed collated

Method: print-job:set-n-up self n-up
Method: set-n-up self n-up

Sets the n-up setting for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

n-up

Passed: an unsigned 32-bit integer.

the n-up value

Method: print-job:set-n-up-layout self layout
Method: set-n-up-layout self layout

Sets the n-up layout setting for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

layout

Passed: a <GtkNumberUpLayout>, or one of its symbols.

the n-up layout setting

Method: print-job:set-num-copies self num-copies
Method: set-num-copies self num-copies

Sets the number of copies for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

num-copies

Passed: a 32-bit integer.

the number of copies

Method: print-job:set-page-ranges self ranges
Method: set-page-ranges self ranges

Sets the page ranges for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

ranges

Passed: a list or vector, each a <GtkPageRange>.

pointer to an array of <GtkPageRange> structs

n-ranges

Not passed: guile-gi gives the length of ranges.

the length of the ranges array

Method: print-job:set-page-set self page-set
Method: set-page-set self page-set

Sets the <GtkPageSet> setting for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

page-set

Passed: a <GtkPageSet>, or one of its symbols.

a <GtkPageSet> setting

Method: print-job:set-pages self pages
Method: set-pages self pages

Sets the <GtkPrintPages> setting for this job.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

pages

Passed: a <GtkPrintPages>, or one of its symbols.

the <GtkPrintPages> setting

Method: print-job:set-reverse self reverse
Method: set-reverse self reverse

Sets whether this job is printed reversed.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

reverse

Passed: a boolean.

whether the job is printed reversed

Method: print-job:set-rotate self rotate
Method: set-rotate self rotate

Sets whether this job is printed rotated.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

rotate

Passed: a boolean.

whether to print rotated

Method: print-job:set-scale self scale
Method: set-scale self scale

Sets the scale for this job.

1.0 means unscaled.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

scale

Passed: a real number.

the scale

Method: print-job:set-source-fd? self fd ⇒ %return
Method: set-source-fd? self fd ⇒ %return

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 printer:accepts-pdf? and printer:accepts-ps?.

This is similar to print-job:set-source-file?, but takes expects an open file descriptor for the file, instead of a filename.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

fd

Passed: a 32-bit integer.

a file descriptor

%return

Returned: a boolean.

#f if an error occurred

Method: print-job:set-source-file? self filename ⇒ %return
Method: set-source-file? self filename ⇒ %return

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 printer:accepts-pdf? and printer:accepts-ps?.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

filename

Passed: a file name, as a string.

the file to be printed

%return

Returned: a boolean.

#f if an error occurred

Method: print-job:set-track-print-status self track-status
Method: set-track-print-status self track-status

If track_status is #t, 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.

self

Passed: a <GtkPrintJob>.

a <GtkPrintJob>

track-status

Passed: a boolean.

#t to track status after printing

Signals

Signal: print-job:status-changed

Connect a handler with (connect object print-job:status-changed handler). It is called as (handler self).

Emitted when the status of a job changes.

The signal handler can use print-job:get-status to obtain the new status.

self

Passed: a <GtkPrintJob>.