Description
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
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_new() to get the defaults,
or use gtk_print_run_page_setup_dialog() to show the page setup dialog
and receive the resulting page setup.
A page setup dialog
Printing support was added in GTK+ 2.10.
Functions
gtk_page_setup_get_paper_size ()
GtkPaperSize *
gtk_page_setup_get_paper_size (GtkPageSetup *setup);
Gets the paper size of the GtkPageSetup.
Returns
the paper size.
[transfer none]
Since: 2.10
gtk_page_setup_get_top_margin ()
gdouble
gtk_page_setup_get_top_margin (GtkPageSetup *setup,
GtkUnit unit);
Gets the top margin in units of unit
.
Since: 2.10
gtk_page_setup_get_bottom_margin ()
gdouble
gtk_page_setup_get_bottom_margin (GtkPageSetup *setup,
GtkUnit unit);
Gets the bottom margin in units of unit
.
Returns
the bottom margin
Since: 2.10
gtk_page_setup_get_left_margin ()
gdouble
gtk_page_setup_get_left_margin (GtkPageSetup *setup,
GtkUnit unit);
Gets the left margin in units of unit
.
Since: 2.10
gtk_page_setup_get_right_margin ()
gdouble
gtk_page_setup_get_right_margin (GtkPageSetup *setup,
GtkUnit unit);
Gets the right margin in units of unit
.
Since: 2.10
gtk_page_setup_set_paper_size_and_default_margins ()
void
gtk_page_setup_set_paper_size_and_default_margins
(GtkPageSetup *setup,
GtkPaperSize *size);
Sets the paper size of the GtkPageSetup and modifies
the margins according to the new paper size.
Since: 2.10
gtk_page_setup_get_paper_height ()
gdouble
gtk_page_setup_get_paper_height (GtkPageSetup *setup,
GtkUnit unit);
Returns the paper height in units of unit
.
Note that this function takes orientation, but
not margins into consideration.
See gtk_page_setup_get_page_height().
Returns
the paper height.
Since: 2.10
gtk_page_setup_new_from_key_file ()
GtkPageSetup *
gtk_page_setup_new_from_key_file (GKeyFile *key_file,
const gchar *group_name,
GError **error);
Reads 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.
Since: 2.12
gtk_page_setup_load_key_file ()
gboolean
gtk_page_setup_load_key_file (GtkPageSetup *setup,
GKeyFile *key_file,
const gchar *group_name,
GError **error);
Reads the page setup from the group group_name
in the key file
key_file
.
Since: 2.14
gtk_page_setup_to_file ()
gboolean
gtk_page_setup_to_file (GtkPageSetup *setup,
const char *file_name,
GError **error);
This function saves the information from setup
to file_name
.
Since: 2.12
gtk_page_setup_to_key_file ()
void
gtk_page_setup_to_key_file (GtkPageSetup *setup,
GKeyFile *key_file,
const gchar *group_name);
This function adds the page setup from setup
to key_file
.
Since: 2.12
gtk_page_setup_to_gvariant ()
GVariant *
gtk_page_setup_to_gvariant (GtkPageSetup *setup);
Serialize page setup to an a{sv} variant.
Return: (transfer none): a new, floating, GVariant
Since: 3.22