Stores page setup information
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-print-operation>
when printing. The benefit of splitting this out of
the <gtk-print-settings>
is that these affect the actual layout of the
page, and thus need to be set long before user prints.
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>
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.
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.
<gtk-page-setup>
)Creates a new
<gtk-page-setup>
.
- ret
- a new
<gtk-page-setup>
.Since 2.10
<gtk-page-setup>
) ⇒ (ret <gtk-page-orientation>
)Gets the page orientation of the
<gtk-page-setup>
.
- setup
- a
<gtk-page-setup>
- ret
- the page orientation
Since 2.10
<gtk-page-setup>
) (orientation <gtk-page-orientation>
)Sets the page orientation of the
<gtk-page-setup>
.
- setup
- a
<gtk-page-setup>
- orientation
- a
<gtk-page-orientation>
valueSince 2.10
<gtk-page-setup>
) ⇒ (ret <gtk-paper-size>
)Gets the paper size of the
<gtk-page-setup>
.
- setup
- a
<gtk-page-setup>
- ret
- the paper size
Since 2.10
<gtk-page-setup>
) (size <gtk-paper-size>
)Sets the paper size of the
<gtk-page-setup>
without changing the margins. Seegtk-page-setup-set-paper-size-and-default-margins
.
- setup
- a
<gtk-page-setup>
- size
- a
<gtk-paper-size>
Since 2.10
<gtk-page-setup>
) (unit <gtk-unit>
) ⇒ (ret double
)Gets the top margin in units of unit.
- setup
- a
<gtk-page-setup>
- unit
- the unit for the return value
- ret
- the top margin
Since 2.10
<gtk-page-setup>
) (margin double
) (unit <gtk-unit>
)Sets the top margin of the
<gtk-page-setup>
.
- setup
- a
<gtk-page-setup>
- margin
- the new top margin in units of unit
- unit
- the units for margin
Since 2.10
<gtk-page-setup>
) (unit <gtk-unit>
) ⇒ (ret double
)Gets the bottom margin in units of unit.
- setup
- a
<gtk-page-setup>
- unit
- the unit for the return value
- ret
- the bottom margin
Since 2.10
<gtk-page-setup>
) (margin double
) (unit <gtk-unit>
)Sets the bottom margin of the
<gtk-page-setup>
.
- setup
- a
<gtk-page-setup>
- margin
- the new bottom margin in units of unit
- unit
- the units for margin
Since 2.10
<gtk-page-setup>
) (unit <gtk-unit>
) ⇒ (ret double
)Gets the left margin in units of unit.
- setup
- a
<gtk-page-setup>
- unit
- the unit for the return value
- ret
- the left margin
Since 2.10
<gtk-page-setup>
) (margin double
) (unit <gtk-unit>
)Sets the left margin of the
<gtk-page-setup>
.
- setup
- a
<gtk-page-setup>
- margin
- the new left margin in units of unit
- unit
- the units for margin
Since 2.10
<gtk-page-setup>
) (unit <gtk-unit>
) ⇒ (ret double
)Gets the right margin in units of unit.
- setup
- a
<gtk-page-setup>
- unit
- the unit for the return value
- ret
- the right margin
Since 2.10
<gtk-page-setup>
) (margin double
) (unit <gtk-unit>
)Sets the right margin of the
<gtk-page-setup>
.
- setup
- a
<gtk-page-setup>
- margin
- the new right margin in units of unit
- unit
- the units for margin
Since 2.10
<gtk-page-setup>
) (unit <gtk-unit>
) ⇒ (ret double
)Returns the paper width in units of unit.
Note that this function takes orientation, but not margins into consideration. See
gtk-page-setup-get-page-width
.
- setup
- a
<gtk-page-setup>
- unit
- the unit for the return value
- ret
- the paper width.
Since 2.10
<gtk-page-setup>
) (unit <gtk-unit>
) ⇒ (ret double
)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
.
- setup
- a
<gtk-page-setup>
- unit
- the unit for the return value
- ret
- the paper height.
Since 2.10
<gtk-page-setup>
) (unit <gtk-unit>
) ⇒ (ret double
)Returns the page width in units of unit.
Note that this function takes orientation and margins into consideration. See
gtk-page-setup-get-paper-width
.
- setup
- a
<gtk-page-setup>
- unit
- the unit for the return value
- ret
- the page width.
Since 2.10
<gtk-page-setup>
) (unit <gtk-unit>
) ⇒ (ret double
)Returns the page height in units of unit.
Note that this function takes orientation and margins into consideration. See
gtk-page-setup-get-paper-height
.
- setup
- a
<gtk-page-setup>
- unit
- the unit for the return value
- ret
- the page height.
Since 2.10