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

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)? data, finalize finalize, freeze_notify : Nil freeze_notify, getv(names : Enumerable(String), values : Enumerable(_)) : Nil getv, 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)? qdata, ref_count : UInt32 ref_count, run_dispose : Nil run_dispose, set_data(key : String, data : Pointer(Void)?) : Nil set_data, set_property(property_name : String, value : _) : Nil set_property, steal_data(key : String) : Pointer(Void)? steal_data, steal_qdata(quark : UInt32) : Pointer(Void)? 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, 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

compat_control(what : UInt64, data : Pointer(Void)?) : 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

Constructor Detail

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

Creates a new Gtk::PrintJob.


def self.new #

Initialize a new PrintJob.


def self.new(*, page_setup : Gtk::PageSetup? = nil, printer : Gtk::Printer? = nil, settings : Gtk::PrintSettings? = nil, title : String? = nil, track_print_status : Bool? = nil) #

Class Method Detail

def self.g_type : UInt64 #

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


Instance Method Detail

def collate : Bool #

Gets whether this job is printed collated.


def collate=(collate : Bool) : Nil #

Sets whether this job is printed collated.


def n_up : UInt32 #

Gets the n-up setting for this job.


def n_up=(n_up : UInt32) : Nil #

Sets the n-up setting for this job.


def n_up_layout : Gtk::NumberUpLayout #

Gets the n-up layout setting for this job.


def n_up_layout=(layout : Gtk::NumberUpLayout) : Nil #

Sets the n-up layout setting for this job.


def num_copies : Int32 #

Gets the number of copies of this job.


def num_copies=(num_copies : Int32) : Nil #

Sets the number of copies for this job.


def page_ranges : Enumerable(Gtk::PageRange) #

Gets the page ranges for this job.


def page_ranges=(ranges : Enumerable(Gtk::PageRange)) : Nil #

Sets the page ranges for this job.


def page_set : Gtk::PageSet #

Gets the Gtk::PageSet setting for this job.


def page_set=(page_set : Gtk::PageSet) : Nil #

Sets the Gtk::PageSet setting for this job.


def page_setup : Gtk::PageSetup? #

def page_setup=(value : Gtk::PageSetup?) : Gtk::PageSetup? #

def pages : Gtk::PrintPages #

Gets the Gtk::PrintPages setting for this job.


def pages=(pages : Gtk::PrintPages) : Nil #

Sets the Gtk::PrintPages setting for this job.


def printer : Gtk::Printer #

Gets the Gtk::Printer of the print job.


def printer=(value : Gtk::Printer?) : Gtk::Printer? #

def reverse : Bool #

Gets whether this job is printed reversed.


def reverse=(reverse : Bool) : Nil #

Sets whether this job is printed reversed.


def rotate : Bool #

Gets whether the job is printed rotated.


def rotate=(rotate : Bool) : Nil #

Sets whether this job is printed rotated.


def scale : Float64 #

Gets the scale for this job.


def scale=(scale : Float64) : Nil #

Sets the scale for this job.

1.0 means unscaled.


def send(callback : Gtk::PrintJobCompleteFunc) : Nil #

Sends the print job off to the printer.


def settings : Gtk::PrintSettings #

Gets the Gtk::PrintSettings of the print job.


def settings=(value : Gtk::PrintSettings?) : Gtk::PrintSettings? #

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.


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.


def status : Gtk::PrintStatus #

Gets the status of the print job.


def status_changed_signal #

def surface : Cairo::Surface #

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


def title : String #

Gets the job title.


def title=(value : String) : String #

def track_print_status : Bool #

Returns whether jobs will be tracked after printing.

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


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.


def track_print_status? : Bool #