gtk.page_setup
Module for [PageSetup] class
Types 3
A gtk.page_setup.PageSetup 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.print_operation.PrintOperation when printing. The benefit of splitting this out of the gtk.print_settings.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 gtk.page_setup.PageSetup use gtk.page_setup.PageSetup.new_ to get the defaults, or use func@Gtk.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;
}PageSetupGidBuilder builder() static nothrowGet builder for [gtk.page_setup.PageSetup] Returns: New builder objectgtk.page_setup.PageSetup newFromFile(string fileName) staticReads the page setup from the file file_name.gtk.page_setup.PageSetup newFromGvariant(glib.variant.Variant variant) static nothrowDesrialize a page setup from an a{sv} variant.gtk.page_setup.PageSetup newFromKeyFile(glib.key_file.KeyFile keyFile, string groupName = null) staticReads the page setup from the group group_name in the key file key_file.gtk.page_setup.PageSetup copy() nothrowCopies a [gtk.page_setup.PageSetup]. Returns: a copy of othergtk.types.PageOrientation getOrientation() nothrowGets the page orientation of the [gtk.page_setup.PageSetup]. Returns: the page orientationgtk.paper_size.PaperSize getPaperSize() nothrowGets the paper size of the [gtk.page_setup.PageSetup]. Returns: the paper sizebool loadFile(string fileName)Reads the page setup from the file file_name.bool loadKeyFile(glib.key_file.KeyFile keyFile, string groupName = null)Reads the page setup from the group group_name in the key file key_file.void setBottomMargin(double margin, gtk.types.Unit unit) nothrowSets the bottom margin of the [gtk.page_setup.PageSetup].void setLeftMargin(double margin, gtk.types.Unit unit) nothrowSets the left margin of the [gtk.page_setup.PageSetup].void setOrientation(gtk.types.PageOrientation orientation) nothrowSets the page orientation of the [gtk.page_setup.PageSetup].void setPaperSize(gtk.paper_size.PaperSize size) nothrowSets the paper size of the [gtk.page_setup.PageSetup] without changing the margins.void setPaperSizeAndDefaultMargins(gtk.paper_size.PaperSize size) nothrowSets the paper size of the [gtk.page_setup.PageSetup] and modifies the margins according to the new paper size.void setRightMargin(double margin, gtk.types.Unit unit) nothrowSets the right margin of the [gtk.page_setup.PageSetup].void setTopMargin(double margin, gtk.types.Unit unit) nothrowSets the top margin of the [gtk.page_setup.PageSetup].bool toFile(string fileName)This function saves the information from setup to file_name.glib.variant.Variant toGvariant() nothrowSerialize page setup to an a{sv} variant. Returns: a new, floating, [glib.variant.Variant]void toKeyFile(glib.key_file.KeyFile keyFile, string groupName = null) nothrowThis function adds the page setup from setup to key_file.Fluent builder implementation template for gtk.page_setup.PageSetup
Fluent builder for gtk.page_setup.PageSetup