PageSetup

open class PageSetup(pointer: <Error class: unknown class><<Error class: unknown class>>)

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 ctor@Gtk.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;
}

Constructors

Link copied to clipboard
constructor()

Creates a new GtkPageSetup.

constructor(fileName: String)

Reads the page setup from the file @file_name.

constructor(variant: <Error class: unknown class>)

Desrialize a page setup from an a{sv} variant.

constructor(keyFile: <Error class: unknown class>, groupName: String? = null)

Reads the page setup from the group @group_name in the key file

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gtkPageSetupPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
open fun copy(): PageSetup

Copies a GtkPageSetup.

Link copied to clipboard
open fun getBottomMargin(unit: Unit): Double

Gets the bottom margin in units of @unit.

Link copied to clipboard
open fun getLeftMargin(unit: Unit): Double

Gets the left margin in units of @unit.

Link copied to clipboard

Gets the page orientation of the GtkPageSetup.

Link copied to clipboard
open fun getPageHeight(unit: Unit): Double

Returns the page height in units of @unit.

Link copied to clipboard
open fun getPageWidth(unit: Unit): Double

Returns the page width in units of @unit.

Link copied to clipboard
open fun getPaperHeight(unit: Unit): Double

Returns the paper height in units of @unit.

Link copied to clipboard

Gets the paper size of the GtkPageSetup.

Link copied to clipboard
open fun getPaperWidth(unit: Unit): Double

Returns the paper width in units of @unit.

Link copied to clipboard
open fun getRightMargin(unit: Unit): Double

Gets the right margin in units of @unit.

Link copied to clipboard
open fun getTopMargin(unit: Unit): Double

Gets the top margin in units of @unit.

Link copied to clipboard
open fun loadFile(fileName: String): <Error class: unknown class><Boolean>

Reads the page setup from the file @file_name.

Link copied to clipboard
open fun loadKeyFile(keyFile: <Error class: unknown class>, groupName: String? = null): <Error class: unknown class><Boolean>

Reads the page setup from the group @group_name in the key file

Link copied to clipboard
open fun setBottomMargin(margin: Double, unit: Unit)

Sets the bottom margin of the GtkPageSetup.

Link copied to clipboard
open fun setLeftMargin(margin: Double, unit: Unit)

Sets the left margin of the GtkPageSetup.

Link copied to clipboard
open fun setOrientation(orientation: PageOrientation)

Sets the page orientation of the GtkPageSetup.

Link copied to clipboard
open fun setPaperSize(size: PaperSize)

Sets the paper size of the GtkPageSetup without changing the margins.

Link copied to clipboard

Sets the paper size of the GtkPageSetup and modifies the margins according to the new paper size.

Link copied to clipboard
open fun setRightMargin(margin: Double, unit: Unit)

Sets the right margin of the GtkPageSetup.

Link copied to clipboard
open fun setTopMargin(margin: Double, unit: Unit)

Sets the top margin of the GtkPageSetup.

Link copied to clipboard
open fun toFile(fileName: String): <Error class: unknown class><Boolean>

This function saves the information from @setup to @file_name.

Link copied to clipboard
open fun toGvariant(): <Error class: unknown class>

Serialize page setup to an a{sv} variant.

Link copied to clipboard
open fun toKeyFile(keyFile: <Error class: unknown class>, groupName: String? = null)

This function adds the page setup from @setup to @key_file.