Gtk.PageSetup
Gtk.PageSetup — Stores page setup information
Object Hierarchy:
GObject
╰── Gtk.PageSetup
Functions:
- new
() -> Gtk.PageSetup
- copy
(self) -> Gtk.PageSetup
- get_orientation
(self) -> Gtk.PageOrientation
- set_orientation
(self, orientation:Gtk.PageOrientation)
- get_paper_size
(self) -> Gtk.PaperSize
- set_paper_size
(self, size:Gtk.PaperSize)
- get_top_margin
(self, unit:Gtk.Unit) -> float
- set_top_margin
(self, margin:float, unit:Gtk.Unit)
- get_bottom_margin
(self, unit:Gtk.Unit) -> float
- set_bottom_margin
(self, margin:float, unit:Gtk.Unit)
- get_left_margin
(self, unit:Gtk.Unit) -> float
- set_left_margin
(self, margin:float, unit:Gtk.Unit)
- get_right_margin
(self, unit:Gtk.Unit) -> float
- set_right_margin
(self, margin:float, unit:Gtk.Unit)
- set_paper_size_and_default_margins
(self, size:Gtk.PaperSize)
- get_paper_width
(self, unit:Gtk.Unit) -> float
- get_paper_height
(self, unit:Gtk.Unit) -> float
- get_page_width
(self, unit:Gtk.Unit) -> float
- get_page_height
(self, unit:Gtk.Unit) -> float
- new_from_file
(file_name:str) -> Gtk.PageSetup
- new_from_key_file
(key_file:GLib.KeyFile, group_name:str=None) -> Gtk.PageSetup
- load_file
(self, file_name:str) -> bool
- load_key_file
(self, key_file:GLib.KeyFile, group_name:str=None) -> bool
- to_file
(self, file_name:str) -> bool
- to_key_file
(self, key_file:GLib.KeyFile, group_name:str)
Description:
A Gtk.PageSetup
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 Gtk.PrintSettings 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 Gtk.PageSetup
use Gtk.PageSetup::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.
Printing support was added in GTK+ 2.10.
Function Details:
new()
new () -> Gtk.PageSetup
Creates a new Gtk.PageSetup
.
Returns: a new
Gtk.PageSetup
.Since: 2.10
copy()
copy (self) -> Gtk.PageSetup
Copies a Gtk.PageSetup
.
Returns: a copy of
other
.Since: 2.10
get_orientation()
get_orientation (self) -> Gtk.PageOrientation
Gets the page orientation of the Gtk.PageSetup
.
Returns: the page orientation
Since: 2.10
set_orientation()
set_orientation (self, orientation:Gtk.PageOrientation)
Sets the page orientation of the Gtk.PageSetup
.
- Since: 2.10
get_paper_size()
get_paper_size (self) -> Gtk.PaperSize
Gets the paper size of the Gtk.PageSetup
.
Returns: the paper size.
Since: 2.10
set_paper_size()
set_paper_size (self, size:Gtk.PaperSize)
Sets the paper size of the Gtk.PageSetup
withoutchanging the margins. See Gtk.PageSetup:set_paper_size_and_default_margins()
.
- Since: 2.10
get_top_margin()
get_top_margin (self, unit:Gtk.Unit) -> float
Gets the top margin in units of unit
.
Returns: the top margin
Since: 2.10
set_top_margin()
set_top_margin (self, margin:float, unit:Gtk.Unit)
Sets the top margin of the Gtk.PageSetup
.
- Since: 2.10
get_bottom_margin()
get_bottom_margin (self, unit:Gtk.Unit) -> float
Gets the bottom margin in units of unit
.
Returns: the bottom margin
Since: 2.10
set_bottom_margin()
set_bottom_margin (self, margin:float, unit:Gtk.Unit)
Sets the bottom margin of the Gtk.PageSetup
.
- Since: 2.10
get_left_margin()
get_left_margin (self, unit:Gtk.Unit) -> float
Gets the left margin in units of unit
.
Returns: the left margin
Since: 2.10
set_left_margin()
set_left_margin (self, margin:float, unit:Gtk.Unit)
Sets the left margin of the Gtk.PageSetup
.
- Since: 2.10
get_right_margin()
get_right_margin (self, unit:Gtk.Unit) -> float
Gets the right margin in units of unit
.
Returns: the right margin
Since: 2.10
set_right_margin()
set_right_margin (self, margin:float, unit:Gtk.Unit)
Sets the right margin of the Gtk.PageSetup
.
- Since: 2.10
set_paper_size_and_default_margins()
set_paper_size_and_default_margins (self, size:Gtk.PaperSize)
Sets the paper size of the Gtk.PageSetup
and modifiesthe margins according to the new paper size.
- Since: 2.10
get_paper_width()
get_paper_width (self, unit:Gtk.Unit) -> float
Returns the paper width in units of unit
.
Note that this function takes orientation, but not margins into consideration. See Gtk.PageSetup:get_page_width()
.
Returns: the paper width.
Since: 2.10
get_paper_height()
get_paper_height (self, unit:Gtk.Unit) -> float
Returns the paper height in units of unit
.
Note that this function takes orientation, but not margins into consideration.See Gtk.PageSetup:get_page_height()
.
Returns: the paper height.
Since: 2.10
get_page_width()
get_page_width (self, unit:Gtk.Unit) -> float
Returns the page width in units of unit
.
Note that this function takes orientation andmargins into consideration. See Gtk.PageSetup:get_paper_width()
.
Returns: the page width.
Since: 2.10
get_page_height()
get_page_height (self, unit:Gtk.Unit) -> float
Returns the page height in units of unit
.
Note that this function takes orientation andmargins into consideration. See Gtk.PageSetup:get_paper_height()
.
Returns: the page height.
Since: 2.10
new_from_file()
new_from_file (file_name:str) -> Gtk.PageSetup
Reads the page setup from the file file_name
. Returns a new Gtk.PageSetup
object with the restored page setup, or None
if an error occurred. See Gtk.PageSetup:to_file()
.
Returns: the restored Gtk.PageSetup
Since: 2.12
new_from_key_file()
new_from_key_file (key_file:GLib.KeyFile, group_name:str=None) -> Gtk.PageSetup
Reads the page setup from the group group_name
in the key filekey_file
. Returns a new Gtk.PageSetup
object with the restoredpage setup, or None
if an error occurred.
Returns: the restored Gtk.PageSetup
Since: 2.12
load_file()
load_file (self, file_name:str) -> bool
Reads the page setup from the file file_name
.See Gtk.PageSetup:to_file()
.
Returns:
True
on successSince: 2.14
load_key_file()
load_key_file (self, key_file:GLib.KeyFile, group_name:str=None) -> bool
Reads the page setup from the group group_name
in the key filekey_file
.
Returns:
True
on successSince: 2.14
to_file()
to_file (self, file_name:str) -> bool
This function saves the information from setup
to file_name
.
Returns:
True
on successSince: 2.12
to_key_file()
to_key_file (self, key_file:GLib.KeyFile, group_name:str)
This function adds the page setup from setup
to key_file
.
- Since: 2.12