class Gtk::PrintJob

Overview

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 Gtk::PrintJob#surface to obtain the cairo surface onto which the pages must be drawn. Use Gtk::PrintJob#send to send the finished job to the printer. If you don’t use cairo Gtk::PrintJob also supports printing of manually generated PostScript, via Gtk::PrintJob#source_file=.

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/print_job.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class GObject::Object

==(other : self) ==, bind_property(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags) : GObject::Binding bind_property, bind_property_full(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags, transform_to : GObject::Closure, transform_from : GObject::Closure) : GObject::Binding bind_property_full, data(key : String) : Pointer(Void) | Nil data, finalize finalize, freeze_notify : Nil freeze_notify, getv(names : Enumerable(String), values : Enumerable(_)) : Nil getv, hash(hasher) hash, notify(property_name : String) : Nil notify, notify_by_pspec(pspec : GObject::ParamSpec) : Nil notify_by_pspec, notify_signal notify_signal, property(property_name : String, value : _) : Nil property, qdata(quark : UInt32) : Pointer(Void) | Nil qdata, ref_count : UInt32 ref_count, run_dispose : Nil run_dispose, set_data(key : String, data : Pointer(Void) | Nil) : Nil set_data, set_property(property_name : String, value : _) : Nil set_property, steal_data(key : String) : Pointer(Void) | Nil steal_data, steal_qdata(quark : UInt32) : Pointer(Void) | Nil steal_qdata, thaw_notify : Nil thaw_notify, to_unsafe : Pointer(Void) to_unsafe, watch_closure(closure : GObject::Closure) : Nil watch_closure

Constructor methods inherited from class GObject::Object

cast(obj : GObject::Object) : self cast, new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
new
new
, newv(object_type : UInt64, parameters : Enumerable(GObject::Parameter)) : self newv

Class methods inherited from class GObject::Object

cast?(obj : GObject::Object) : self | Nil cast?, compat_control(what : UInt64, data : Pointer(Void) | Nil) : UInt64 compat_control, g_type : UInt64 g_type, interface_find_property(g_iface : GObject::TypeInterface, property_name : String) : GObject::ParamSpec interface_find_property, interface_list_properties(g_iface : GObject::TypeInterface) : Enumerable(GObject::ParamSpec) interface_list_properties

Macros inherited from class GObject::Object

previous_vfunc(*args) previous_vfunc, previous_vfunc!(*args) previous_vfunc!, signal(signature) signal

Constructor Detail

def self.new(title : String, printer : Gtk::Printer, settings : Gtk::PrintSettings, page_setup : Gtk::PageSetup) : self #

Creates a new Gtk::PrintJob.


[View source]
def self.new #

Initialize a new PrintJob.


[View source]
def self.new(*, page_setup : Gtk::PageSetup | Nil = nil, printer : Gtk::Printer | Nil = nil, settings : Gtk::PrintSettings | Nil = nil, title : String | Nil = nil, track_print_status : Bool | Nil = nil) #

[View source]

Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def collate : Bool #

Gets whether this job is printed collated.


[View source]
def collate=(collate : Bool) : Nil #

Sets whether this job is printed collated.


[View source]
def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


def n_up : UInt32 #

Gets the n-up setting for this job.


[View source]
def n_up=(n_up : UInt32) : Nil #

Sets the n-up setting for this job.


[View source]
def n_up_layout : Gtk::NumberUpLayout #

Gets the n-up layout setting for this job.


[View source]
def n_up_layout=(layout : Gtk::NumberUpLayout) : Nil #

Sets the n-up layout setting for this job.


[View source]
def num_copies : Int32 #

Gets the number of copies of this job.


[View source]
def num_copies=(num_copies : Int32) : Nil #

Sets the number of copies for this job.


[View source]
def page_ranges : Enumerable(Gtk::PageRange) #

Gets the page ranges for this job.


[View source]
def page_ranges=(ranges : Enumerable(Gtk::PageRange)) : Nil #

Sets the page ranges for this job.


[View source]
def page_set : Gtk::PageSet #

Gets the Gtk::PageSet setting for this job.


[View source]
def page_set=(page_set : Gtk::PageSet) : Nil #

Sets the Gtk::PageSet setting for this job.


[View source]
def page_setup : Gtk::PageSetup | Nil #

[View source]
def page_setup=(value : Gtk::PageSetup | Nil) : Gtk::PageSetup | Nil #

[View source]
def pages : Gtk::PrintPages #

Gets the Gtk::PrintPages setting for this job.


[View source]
def pages=(pages : Gtk::PrintPages) : Nil #

Sets the Gtk::PrintPages setting for this job.


[View source]
def printer : Gtk::Printer #

Gets the Gtk::Printer of the print job.


[View source]
def printer=(value : Gtk::Printer | Nil) : Gtk::Printer | Nil #

[View source]
def reverse : Bool #

Gets whether this job is printed reversed.


[View source]
def reverse=(reverse : Bool) : Nil #

Sets whether this job is printed reversed.


[View source]
def rotate : Bool #

Gets whether the job is printed rotated.


[View source]
def rotate=(rotate : Bool) : Nil #

Sets whether this job is printed rotated.


[View source]
def scale : Float64 #

Gets the scale for this job.


[View source]
def scale=(scale : Float64) : Nil #

Sets the scale for this job.

1.0 means unscaled.


[View source]
def send(callback : Gtk::PrintJobCompleteFunc) : Nil #

Sends the print job off to the printer.


[View source]
def settings : Gtk::PrintSettings #

Gets the Gtk::PrintSettings of the print job.


[View source]
def settings=(value : Gtk::PrintSettings | Nil) : Gtk::PrintSettings | Nil #

[View source]
def source_fd=(fd : Int32) : Bool #

Make the Gtk::PrintJob 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 Gtk::Printer#accepts_pdf and Gtk::Printer#accepts_ps.

This is similar to Gtk::PrintJob#source_file=, but takes expects an open file descriptor for the file, instead of a filename.


[View source]
def source_file=(filename : String) : Bool #

Make the Gtk::PrintJob 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 Gtk::Printer#accepts_pdf and Gtk::Printer#accepts_ps.


[View source]
def status : Gtk::PrintStatus #

Gets the status of the print job.


[View source]
def status_changed_signal #

[View source]
def surface : Cairo::Surface #

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


[View source]
def title : String #

Gets the job title.


[View source]
def title=(value : String) : String #

[View source]
def title=(value : Nil) : Nil #

Set #title property to nil.


[View source]
def title? : String | Nil #

Same as #title, but can return nil.


[View source]
def track_print_status : Bool #

Returns whether jobs will be tracked after printing.

For details, see Gtk::PrintJob#track_print_status=.


[View source]
def track_print_status=(track_status : Bool) : Nil #

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.


[View source]
def track_print_status? : Bool #

[View source]