PageSetup


Object Hierarchy:

Gtk.PageSetup Gtk.PageSetup Gtk.PageSetup GLib.Object GLib.Object GLib.Object->Gtk.PageSetup

Description:

[ CCode ( type_id = "gtk_page_setup_get_type ()" ) ]
public sealed class PageSetup : Object

A GtkPageSetup object stores the page size, orientation and margins.

The idea is that you can get one of these from the page setup dialog and then pass it to the PrintOperation when printing. The benefit of splitting this out of the PrintSettings is that these affect the actual layout of the page, and thus need to be set long before user prints.

Margins

The margins specified in this object are the “print margins”, i.e. the parts of the page that the printer cannot print on. These are different from the layout margins that a word processor uses; they are typically used to determine the minimal size for the layout margins.

To obtain a PageSetup use PageSetup to get the defaults, or use print_run_page_setup_dialog to show the page setup dialog and receive the resulting page setup.

A page setup dialog

static GtkPrintSettings *settings = NULL;
static GtkPageSetup *page_setup = NULL;

static void
do_page_setup (void)
{
GtkPageSetup *new_page_setup;

if (settings == NULL)
settings = gtk_print_settings_new ();

new_page_setup = gtk_print_run_page_setup_dialog (GTK_WINDOW (main_window),
page_setup, settings);

if (page_setup)
g_object_unref (page_setup);

page_setup = new_page_setup;
}

Printing support was added in GTK+ 2.10.


Namespace: Gtk
Package: gtk+-3.0

Content:

Creation methods:

Methods:

Inherited Members: