Gtk::PageSetup
class Gtk::PageSetup
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 Gtk::PrittntOperation? 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.
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::PrintOperation.run_page_setup_dialog to show the page setup dialog and receive the resulting page setup.
Class Methods
Gtk::PageSetup.new
-
Creates a new Gtk::PageSetup. Since 2.10
- Returns: a new Gtk::PageSetup
Instance Methods
dup
-
Duplicates a Gtk::PageSetup. Since 2.10
- Returns: a copy of self
get_top_margin(unit)
-
Gets the top margin in units of unit. Since 2.10
- unit: the unit for the return value (Gtk::PaperSize#Unit)
- Returns: the top margin
set_top_margin(margin, unit)
-
Sets the top margin of the Gtk::PageSetup. Since 2.10
- margin: the new top margin in units of unit (Gtk::PaperSize#Unit)
- unit: the units for margin
- Returns: self
get_bottom_margin(unit)
-
Gets the bottom margin in units of unit. Since 2.10
- unit: the unit for the return value
- Returns: the bottom margin
set_bottom_margin(margin, unit)
-
Sets the bottom margin of the Gtk::PageSetup. Since 2.10
- margin: the new bottom margin in units of unit (Gtk::PaperSize#Unit)
- unit: the units for margin
- Returns: self
get_left_margin(unit)
-
Gets the left margin in units of unit. Since 2.10
- unit: the unit for the return value
- Returns: the left margin
set_left_margin(margin, unit)
-
Sets the left margin of the Gtk::PageSetup.
- margin: the new left margin in units of unit (Gtk::PaperSize#Unit)
- unit: the units for margin
- Returns: self
get_right_margin(unit)
-
Gets the right margin in units of unit. Since 2.10
- unit: the unit for the return value (Gtk::PaperSize#Unit)
- Returns: the right margin
set_right_margin(margin, unit)
-
Sets the right margin of the Gtk::PageSetup. Since 2.10
- margin: the new right margin in units of unit (Gtk::PaperSize#Unit)
- unit: the units for margin
- Returns: self
orientation
-
Gets the page orientation of the Gtk::PageSetup. Since 2.10
- Returns: the page orientation
orientation=(orientation)
-
Sets the page orientation of the Gtk::PageSetup. Since 2.10
- orientation: a Gtk::PrintSettings#PageOrientation value
- Returns: orientation
set_orientation(orientation)
-
Same as #orientation=.
- Returns: self
get_page_height(unit)
-
Returns the page height in units of unit.
Note that this function takes orientation and margins into consideration. See Gtk::PageSetup#paper_height. Since 2.10
- unit: the unit for the return value (Gtk::PaperSize#Unit)
- Returns: the page height.
get_page_width(unit)
-
Returns the page width in units of unit.
Note that this function takes orientation and margins into consideration. See Gtk::PageSetup#paper_width. Since 2.10
- unit: the unit for the return value (Gtk::PaperSize#Unit)
- Returns: the page width.
get_paper_height(unit)
-
Returns the paper height in units of unit.
Note that this function takes orientation and not margins into consideration. See Gtk::PageSetup#page_height. Since 2.10
- unit: the unit for the return value (Gtk::PaperSize#Unit)
- Returns: the paper height.
get_paper_width(unit)
-
Returns the paper width in units of unit.
Note that this function takes orientation and not margins into consideration. See Gtk::PageSetup#page_width. Since 2.10
- unit: the unit for the return value (Gtk::PaperSize#Unit)
- Returns: the paper width.
paper_size
-
Gets the paper size of the Gtk::PageSetup. Since 2.10
- Returns: the paper size
paper_size=(size)
-
Sets the paper size of the Gtk::PageSetup without
changing the margins. See
Gtk::PageSetup#set_paper_size_and_default_margins. Since 2.10
- size: a Gtk::PaperSize
- Returns: size
set_paper_size(size)
-
Same as #paper_size= Since 2.10
- Returns: self
paper_size_and_default_margins=(size)
-
Sets the paper size of the Gtk::PageSetup and modifies
the margins according to the new paper size. Since 2.10
- size: a Gtk::PaperSize
- Returns: size
set_paper_size_and_default_margins(size)
-
Same as #paper_size_and_default_margins=. Since 2.10
- Returns: self
Keyword(s):
References:[Gtk::PrintContext] [Gtk::PrintUnixDialog] [Gtk::PrintOperationPreview] [Gtk::PageSetupUnixDialog] [Gtk::PageSetup] [index-ruby-gtk2] [Gtk::PrintOperation] [Ruby/GTK] [api-gtk-index] [Gtk::PrintJob]