1.158 <GtkPrinter>

Class: <GtkPrinter>

It derives from <GObject>.

Represents a printer.

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

A <GtkPrinter> allows to get status information about the printer, such as its description, its location, the number of queued jobs, etc. Most importantly, a <GtkPrinter> object can be used to create a <GtkPrintJob> object, which lets you print to the printer.

Properties

Property: printer:accepting-jobs self

#t if the printer is accepting jobs.

Its value is a boolean.

It is read only.

Property: printer:accepts-pdf self

#t if this printer can accept PDF.

Its value is a boolean.

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

Property: printer:accepts-ps self

#t if this printer can accept PostScript.

Its value is a boolean.

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

Property: printer:icon-name self

Icon name to use for the printer.

Its value is a string, or #f.

It is read only.

Property: printer:is-virtual self

#f if this represents a real hardware device.

Its value is a boolean.

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

Property: printer:job-count self

Number of jobs queued in the printer.

Its value is a 32-bit integer.

It is read only.

Property: printer:location self

Information about the location of the printer.

Its value is a string, or #f.

It is read only.

Property: printer:name self

The name of the printer.

Its value is a string, or #f.

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

Property: printer:paused self

#t if this printer is paused.

A paused printer still accepts jobs, but it does not print them.

Its value is a boolean.

It is read only.

Property: printer:state-message self

String giving the current status of the printer.

Its value is a string, or #f.

It is read only.

Procedures

Method: printer:accepts-pdf? self ⇒ %return
Method: accepts-pdf? self ⇒ %return

Returns whether the printer accepts input in PDF format.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a boolean.

#t if self accepts PDF

Method: printer:accepts-ps? self ⇒ %return
Method: accepts-ps? self ⇒ %return

Returns whether the printer accepts input in PostScript format.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a boolean.

#t if self accepts PostScript

Method: printer:compare self b ⇒ %return
Method: compare self b ⇒ %return

Compares two printers.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

b

Passed: a <GtkPrinter>.

another <GtkPrinter>

%return

Returned: a 32-bit integer.

0 if the printer match, a negative value if self < b, or a positive value if self > b

Method: printer:get-capabilities self ⇒ %return
Method: get-capabilities self ⇒ %return

Returns the printer’s capabilities.

This is useful when you’re using <GtkPrintUnixDialog>’s manual-capabilities setting and need to know which settings the printer can handle and which you must handle yourself.

This will return 0 unless the printer’s details are available, see printer:has-details? and printer:request-details.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a <GtkPrintCapabilities>.

the printer’s capabilities

Method: printer:get-default-page-size self ⇒ %return
Method: get-default-page-size self ⇒ %return

Returns default page size of self.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a <GtkPageSetup>.

a newly allocated <GtkPageSetup> with default page size of the printer.

Method: printer:get-description self ⇒ %return
Method: get-description self ⇒ %return

Gets the description of the printer.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a string.

the description of self

Method: printer:get-hard-margins self ⇒ %return top bottom left right
Method: get-hard-margins self ⇒ %return top bottom left right

Retrieve the hard margins of self.

These are the margins that define the area at the borders of the paper that the printer cannot print to.

Note: This will not succeed unless the printer’s details are available, see printer:has-details? and printer:request-details.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a boolean.

#t iff the hard margins were retrieved

top

Returned: a real number.

a location to store the top margin in

bottom

Returned: a real number.

a location to store the bottom margin in

left

Returned: a real number.

a location to store the left margin in

right

Returned: a real number.

a location to store the right margin in

Method: printer:get-hard-margins-for-paper-size self paper-size ⇒ %return top bottom left right
Method: get-hard-margins-for-paper-size self paper-size ⇒ %return top bottom left right

Retrieve the hard margins of self for paper-size.

These are the margins that define the area at the borders of the paper that the printer cannot print to.

Note: This will not succeed unless the printer’s details are available, see printer:has-details? and printer:request-details.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

paper-size

Passed: a <GtkPaperSize>.

a <GtkPaperSize>

%return

Returned: a boolean.

#t iff the hard margins were retrieved

top

Returned: a real number.

a location to store the top margin in

bottom

Returned: a real number.

a location to store the bottom margin in

left

Returned: a real number.

a location to store the left margin in

right

Returned: a real number.

a location to store the right margin in

Method: printer:get-icon-name self ⇒ %return
Method: get-icon-name self ⇒ %return

Gets the name of the icon to use for the printer.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a string.

the icon name for self

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

Gets the number of jobs currently queued on the printer.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a 32-bit integer.

the number of jobs on self

Method: printer:get-location self ⇒ %return
Method: get-location self ⇒ %return

Returns a description of the location of the printer.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a string.

the location of self

Method: printer:get-name self ⇒ %return
Method: get-name self ⇒ %return

Returns the name of the printer.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a string.

the name of self

Method: printer:get-state-message self ⇒ %return
Method: get-state-message self ⇒ %return

Returns the state message describing the current state of the printer.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a string.

the state message of self

Method: printer:has-details? self ⇒ %return
Method: has-details? self ⇒ %return

Returns whether the printer details are available.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a boolean.

#t if self details are available

Method: printer:is-accepting-jobs? self ⇒ %return
Method: is-accepting-jobs? self ⇒ %return

Returns whether the printer is accepting jobs

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a boolean.

#t if self is accepting jobs

Method: printer:is-active? self ⇒ %return
Method: is-active? self ⇒ %return

Returns whether the printer is currently active (i.e. accepts new jobs).

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a boolean.

#t if self is active

Method: printer:is-default? self ⇒ %return
Method: is-default? self ⇒ %return

Returns whether the printer is the default printer.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a boolean.

#t if self is the default

Method: printer:is-paused? self ⇒ %return
Method: is-paused? self ⇒ %return

Returns whether the printer is currently paused.

A paused printer still accepts jobs, but it is not printing them.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a boolean.

#t if self is paused

Method: printer:is-virtual? self ⇒ %return
Method: is-virtual? self ⇒ %return

Returns whether the printer is virtual (i.e. does not represent actual printer hardware, but something like a CUPS class).

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a boolean.

#t if self is virtual

Method: printer:list-papers self ⇒ %return
Method: list-papers self ⇒ %return

Lists all the paper sizes self supports.

This will return and empty list unless the printer’s details are available, see printer:has-details? and printer:request-details.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

%return

Returned: a list, each a <GtkPageSetup>.

a newly allocated list of newly allocated <GtkPageSetup>s.

Method: printer:request-details self
Method: request-details self

Requests the printer details.

When the details are available, the printer:details-acquired signal will be emitted on self.

self

Passed: a <GtkPrinter>.

a <GtkPrinter>

Signals

Signal: printer:details-acquired

Connect a handler with (connect object printer:details-acquired handler). It is called as (handler self success).

Emitted in response to a request for detailed information about a printer from the print backend.

The success parameter indicates if the information was actually obtained.

self

Passed: a <GtkPrinter>.

success

Passed: a boolean.

#t if the details were successfully acquired