Crear  Editar  FrontPage  Indexes  Buscar  Cambios  History  RSS  Login

Gtk::PaperSize

class Gtk::PaperSize

Gtk::PaperSize handles paper sizes. It uses the standard called "PWG 5101.1-2002 PWG: Standard for Media Standardized Names" to name the paper sizes (and to get the data for the page sizes). In addition to standard paper sizes, Gtk::PaperSize allows to construct custom paper sizes with arbitrary dimensions.

The Gtk::PaperSize object stores not only the dimensions (width and height) of a paper size and its name, it also provides default print margins.

Class Methods

Gtk::PaperSize.default
Returns the name of the default paper size, which depends on the current locale.
  • Returns: the name of the default paper size.
Gtk::PaperSize.new(name=nil)

Creates a new Gtk::PaperSize object by parsing a PWG 5101.1-2002 PWG paper name.

If name is nil, the default paper size is returned, see Gtk::PaperSize.default.

Gtk::PaperSize.new(ppd_name, ppd_display_name, width, height)

Creates a new Gtk::PaperSize object by using PPD information.

If ppd_name is not a recognized PPD paper name, ppd_display_name, width and height are used to construct a custom Gtk::PaperSize object.

  • ppd_name: a PPD paper name
  • ppd_display_name: the corresponding human-readable name
  • width: the paper width, in points
  • height: the paper height in points
  • Returns: a new Gtk::PaperSize
Gtk::PaperSize.new(name, display_name, width, height, unit)
Creates a new Gtk::PaperSize object with the given parameters.
  • name: the paper name
  • display_name: the human-readable name
  • width: the paper width, in units of unit
  • height: the paper height, in units of unit
  • unit: the unit for width and height
  • Returns: a new Gtk::PaperSize object

Instance Methods

==(other)
Compares two Gtk::PaperSize objects.
  • other: another Gtk::PaperSize.
  • Returns: true, if self and other represent the same paper size
custom?
Returns true if self is not a standard paper size.
  • Returns: whether self is a custom paper size.
default_top_margin(unit)
Gets the default top margin for the Gtk::PaperSize.
default_bottom_margin(unit)
Gets the default bottom margin for the Gtk::PaperSize.
  • unit: the unit for the return value as Gtk::PaperSize#Unit
  • Returns: the default bottom margin
default_left_margin(unit)
Gets the default left margin for the Gtk::PaperSize.
default_margin_margin(unit)
Gets the default margin margin for the Gtk::PaperSize.
  • unit: the unit for the return value as Gtk::PaperSize#Unit
  • Returns: the default margin margin
name
Gets the name of the Gtk::PaperSize.
  • Returns: the name of self
display_name
Gets the human-readable name of the Gtk::PaperSize.
  • Returns: the human-readable name of self
ppd_name
Gets the PPD name of the Gtk::PaperSize, which may be nil.
  • Returns: the PPD name of self
width(unit)
Gets the paper width of the Gtk::PaperSize, in units of unit.
  • unit: the unit for the return value
  • Returns: the paper width
height(unit)
Gets the paper height of the Gtk::PaperSize, in units of unit.
  • unit: the unit for the return value
  • Returns: the paper height
set_size(size, width, height, unit)
Changes the dimensions of a size to width x height.
  • size: a custom Gtk::PaperSize object
  • width: the new width in units of unit
  • height: the new height in units of unit
  • unit: the unit for width and height
  • Returns: self

ChangeLog

  • 2006-07-09: updated for 2.10. - kou?

- kou?

Ultimas actualizaciones:2011/06/05 23:13:42
Clave:
Referencias:[Gtk::PageSetup] [Gtk::PaperSize] [Gtk::PrintSettings]