gtk.page_setup
Module for [PageSetup] class
Types 3
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 #GtkPrintOperation when printing. The benefit of splitting this out of the #GtkPrintSettings is that these affect the actual layout of the page, and thus need to be set long before user prints.
Margins ## {#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 minimal size for the layout margins.
To obtain a #GtkPageSetup use gtk.page_setup.PageSetup.new_ to get the defaults, or use gtk.global.printRunPageSetupDialog 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.
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. Returns a new #GtkPageSetup object with the restored page setup, or null if an error occurred. See [gtk.page_setup.PageSetup.toFile].gtk.page_setup.PageSetup newFromGvariant(glib.variant.Variant variant) static nothrowDesrialize a page setup from an a{sv} variant in the format produced by [gtk.page_setup.PageSetup.toGvariant].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. Returns a new #GtkPageSetup object with the restored page setup, or null if an error occurred.gtk.types.PageOrientation getOrientation() nothrowGets the page orientation of the #GtkPageSetup. Returns: the page orientationgtk.paper_size.PaperSize getPaperSize() nothrowGets the paper size of the #GtkPageSetup. Returns: the paper sizebool loadFile(string fileName)Reads the page setup from the file file_name. See [gtk.page_setup.PageSetup.toFile].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 #GtkPageSetup.void setLeftMargin(double margin, gtk.types.Unit unit) nothrowSets the left margin of the #GtkPageSetup.void setOrientation(gtk.types.PageOrientation orientation) nothrowSets the page orientation of the #GtkPageSetup.void setPaperSize(gtk.paper_size.PaperSize size) nothrowSets the paper size of the #GtkPageSetup without changing the margins. See [gtk.page_setup.PageSetup.setPaperSizeAndDefaultMargins].void setPaperSizeAndDefaultMargins(gtk.paper_size.PaperSize size) nothrowSets the paper size of the #GtkPageSetup and modifies the margins according to the new paper size.void setRightMargin(double margin, gtk.types.Unit unit) nothrowSets the right margin of the #GtkPageSetup.void setTopMargin(double margin, gtk.types.Unit unit) nothrowSets the top margin of the #GtkPageSetup.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, #GVariantvoid 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