Class: Gtk::PrintJob

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Overview

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 [classGtk.PrintUnixDialog] API.

Use [methodGtk.PrintJob.get_surface] to obtain the cairo surface onto which the pages must be drawn. Use [methodGtk.PrintJob.send] to send the finished job to the printer. If you don’t use cairo GtkPrintJob also supports printing of manually generated PostScript, via [methodGtk.PrintJob.set_source_file].

Instance Method Summary collapse

Constructor Details

#initialize(title, printer, settings, page_setup) ⇒ Gtk::PrintJob

Creates a new GtkPrintJob.

Parameters:

Instance Method Details

#collateBoolean

Gets whether this job is printed collated.

Returns:

  • (Boolean)

    whether the job is printed collated

#collate=(collate) ⇒ nil

Sets whether this job is printed collated.

Parameters:

  • collate (Boolean)

    whether the job is printed collated

Returns:

  • (nil)

#get_page_ranges(n_ranges) ⇒ Array<Gtk::PageRange>

Gets the page ranges for this job.

Parameters:

  • n_ranges (Integer)

    return location for the number of ranges

Returns:

  • (Array<Gtk::PageRange>)

    a pointer to an array of GtkPageRange structs

#n_upInteger

Gets the n-up setting for this job.

Returns:

  • (Integer)

    the n-up setting

#n_up=(n_up) ⇒ nil

Sets the n-up setting for this job.

Parameters:

  • n_up (Integer)

    the n-up value

Returns:

  • (nil)

#n_up_layoutGtk::NumberUpLayout

Gets the n-up layout setting for this job.

Returns:

#n_up_layout=(layout) ⇒ nil

Sets the n-up layout setting for this job.

Parameters:

Returns:

  • (nil)

#num_copiesInteger

Gets the number of copies of this job.

Returns:

  • (Integer)

    the number of copies

#num_copies=(num_copies) ⇒ nil

Sets the number of copies for this job.

Parameters:

  • num_copies (Integer)

    the number of copies

Returns:

  • (nil)

#page_setGtk::PageSet

Gets the GtkPageSet setting for this job.

Returns:

#page_set=(page_set) ⇒ nil

Sets the GtkPageSet setting for this job.

Parameters:

Returns:

  • (nil)

#page_setupGtk::PageSetup

Page setup.

Returns:

#page_setup=(page_setup) ⇒ Gtk::PageSetup

Page setup.

Parameters:

Returns:

#pagesGtk::PrintPages

Gets the GtkPrintPages setting for this job.

Returns:

#pages=(pages) ⇒ nil

Sets the GtkPrintPages setting for this job.

Parameters:

Returns:

  • (nil)

#printerGtk::Printer

The printer to send the job to.

Returns:

#printer=(printer) ⇒ Gtk::Printer

The printer to send the job to.

Parameters:

Returns:

#reverseBoolean

Gets whether this job is printed reversed.

Returns:

  • (Boolean)

    whether the job is printed reversed.

#reverse=(reverse) ⇒ nil

Sets whether this job is printed reversed.

Parameters:

  • reverse (Boolean)

    whether the job is printed reversed

Returns:

  • (nil)

#rotateBoolean

Gets whether the job is printed rotated.

Returns:

  • (Boolean)

    whether the job is printed rotated

#rotate=(rotate) ⇒ nil

Sets whether this job is printed rotated.

Parameters:

  • rotate (Boolean)

    whether to print rotated

Returns:

  • (nil)

#scaleFloat

Gets the scale for this job.

Returns:

  • (Float)

    the scale

#scale=(scale) ⇒ nil

Sets the scale for this job.

1.0 means unscaled.

Parameters:

  • scale (Float)

    the scale

Returns:

  • (nil)

#send(callback, user_data, dnotify) ⇒ nil

Sends the print job off to the printer.

Parameters:

  • callback (Gtk::PrintJobCompleteFunc)

    function to call when the job completes or an error occurs

  • user_data (GObject)

    user data that gets passed to callback

  • dnotify (GLib::DestroyNotify)

    destroy notify for user_data

Returns:

  • (nil)

#set_page_ranges(ranges, n_ranges) ⇒ nil

Sets the page ranges for this job.

Parameters:

  • ranges (Array<Gtk::PageRange>)

    pointer to an array of GtkPageRange structs

  • n_ranges (Integer)

    the length of the ranges array

Returns:

  • (nil)

#settingsGtk::PrintSettings

Printer settings.

Returns:

#settings=(settings) ⇒ Gtk::PrintSettings

Printer settings.

Parameters:

Returns:

#source_fd=(fd) ⇒ Boolean

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 [methodGtk.Printer.accepts_pdf] and [methodGtk.Printer.accepts_ps].

This is similar to [methodGtk.PrintJob.set_source_file], but takes expects an open file descriptor for the file, instead of a filename.

Parameters:

  • fd (Integer)

    a file descriptor

Returns:

  • (Boolean)

    false if an error occurred

#source_file=(filename) ⇒ Boolean

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 [methodGtk.Printer.accepts_pdf] and [methodGtk.Printer.accepts_ps].

Parameters:

  • filename (Gtk::filename)

    the file to be printed

Returns:

  • (Boolean)

    false if an error occurred

#statusGtk::PrintStatus

Gets the status of the print job.

Returns:

#surfacecairo::Surface

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

Returns:

  • (cairo::Surface)

    the cairo surface of job

#titleString

The title of the print job.

Returns:

  • (String)

    title

#title=(title) ⇒ String

The title of the print job.

Parameters:

  • title (String)

Returns:

  • (String)

    title

  • (String)

    title

#track_print_statusBoolean

Returns whether jobs will be tracked after printing.

For details, see [methodGtk.PrintJob.set_track_print_status].

Returns:

  • (Boolean)

    true if print job status will be reported after printing

#track_print_status=(track_print_status) ⇒ Boolean

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

Parameters:

  • track_print_status (Boolean)

Returns:

  • (Boolean)

    track-print-status

  • (Boolean)

    track-print-status

#track_print_status?Boolean

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

Returns:

  • (Boolean)

    track-print-status