Gtk.PageSetup
const Gtk = imports.gi.Gtk; let page_setup = new Gtk.PageSetup();
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 Gtk.PrintOperation when printing. The benefit of splitting this out of the Gtk.PrintSettings is that these affect the actual layout of the page, and thus need to be set long before user prints.
<para id="print-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 <emphasis>minimal</emphasis> size for the layout margins. </para>
To obtain a Gtk.PageSetup use Gtk.new to get the defaults, or use print_run_page_setup_dialog to show the page setup dialog and receive the resulting page setup.
<example> <title>A page setup dialog</title> <programlisting> 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; } </programlisting> </example>
Printing support was added in GTK+ 2.10.
Hierarchy
-
GObject.Object
- Gtk.PageSetup
Methods
- Gtk.PageSetup.prototype.copy
- Gtk.PageSetup.prototype.get_bottom_margin
- Gtk.PageSetup.prototype.get_left_margin
- Gtk.PageSetup.prototype.get_orientation
- Gtk.PageSetup.prototype.get_page_height
- Gtk.PageSetup.prototype.get_page_width
- Gtk.PageSetup.prototype.get_paper_height
- Gtk.PageSetup.prototype.get_paper_size
- Gtk.PageSetup.prototype.get_paper_width
- Gtk.PageSetup.prototype.get_right_margin
- Gtk.PageSetup.prototype.get_top_margin
- Gtk.PageSetup.prototype.load_file
- Gtk.PageSetup.prototype.load_key_file
- Gtk.PageSetup.prototype.set_bottom_margin
- Gtk.PageSetup.prototype.set_left_margin
- Gtk.PageSetup.prototype.set_orientation
- Gtk.PageSetup.prototype.set_paper_size
- Gtk.PageSetup.prototype.set_paper_size_and_default_margins
- Gtk.PageSetup.prototype.set_right_margin
- Gtk.PageSetup.prototype.set_top_margin
- Gtk.PageSetup.prototype.to_file
- Gtk.PageSetup.prototype.to_key_file