1
2@c %start of fragment
3
4@node GtkPageSetup
5@chapter GtkPageSetup
6Stores page setup information
7
8@section Overview
9A GtkPageSetup object stores the page size, orientation and margins. The idea is
10that you can get one of these from the page setup dialog and then pass it to the
11@code{<gtk-print-operation>} when printing. The benefit of splitting this out of
12the @code{<gtk-print-settings>} is that these affect the actual layout of the
13page, and thus need to be set long before user prints.
14
15The margins specified in this object are the "print margins", i.e. the parts of
16the page that the printer cannot print on. These are different from the layout
17margins that a word processor uses; they are typically used to determine the
18@emph{minimal} size for the layout margins.
19
20To obtain a @code{<gtk-page-setup>} use @code{gtk-page-setup-new} to get the
21defaults, or use @code{gtk-print-run-page-setup-dialog} to show the page setup
22dialog and receive the resulting page setup.
23
24@example
25
26static GtkPrintSettings *settings = NULL;
27static GtkPageSetup *page_setup = NULL;
28
29static void
30do_page_setup (void)
31@{
32  GtkPageSetup *new_page_setup;
33
34  if (settings == NULL)
35    settings = gtk_print_settings_new ();
36
37  new_page_setup = gtk_print_run_page_setup_dialog (GTK_WINDOW (main_window),
38                                                    page_setup, settings);
39
40  if (page_setup)
41    g_object_unref (page_setup);
42
43  page_setup = new_page_setup;
44@}
45@end example
46
47Printing support was added in GTK+ 2.10.
48
49@section Usage
50@include defuns-gtkpagesetup.xml.texi
51
52@c %end of fragment
53