gtk.PaperSizean object providing support for named paper sizes (new in
PyGTK 2.10)Synopsisgtk.PaperSizegobject.GBoxedgtk.PaperSizenameNonecopyis_equalsize2get_nameget_display_nameget_ppd_nameget_widthunitget_heightunitis_customset_sizewidthheightunitget_default_top_marginunitget_default_bottom_marginunitget_default_left_marginunitget_default_right_marginunitFunctionsgtk.paper_size_new_from_ppdppd_nameppd_display_namewidthheightgtk.paper_size_new_cutomnamedisplay_namewidthheightunitgtk.paper_size_get_defaultDescriptionThis class is available in PyGTK 2.10 and above.A 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). The common standard paper sizes are
named by the . 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. Constructorgtk.PaperSizegtk.PaperSizenameNonename :a paper size name, or NoneReturns :a new gtk.PaperSize.This constructor is available in PyGTK 2.10 and above.Creates a new gtk.PaperSize
object by parsing a PWG 5101.1-2002 PWG paper name. If name is None, the
default paper size is returned, see
paper_size_get_default().Methodsgtk.PaperSize.copycopyReturns :a copy of otherThis method is available in PyGTK 2.10 and above.The copy() method copies an existing gtk.PaperSize.gtk.PaperSize.is_equalis_equalsize2size2 :another gtk.PaperSize
objectReturns :True, if this paper size and
size2 represent the same paper
sizeThis method is available in PyGTK 2.10 and above.The is_equal() method returns the
result of comparing this paper size to the gtk.PaperSize
specified by size2.gtk.PaperSize.get_nameget_nameReturns :the name of the paper sizeThis method is available in PyGTK 2.10 and above.The get_name() method returns the name
of the paper size.gtk.PaperSize.get_display_nameget_display_nameReturns :the human-readable name of the paper
size.This method is available in PyGTK 2.10 and above.The get_display_name() method returns
the human-readable name of the paper size.gtk.PaperSize.get_ppd_nameget_ppd_nameReturns :the PPD name of the paper
size or NoneThis method is available in PyGTK 2.10 and above.The get_ppd_name() method returns the
PPD name of the paper size, which may be
None.gtk.PaperSize.get_widthget_widthunitunit :the unit for the return value - one of the
.Returns :the paper widthThis method is available in PyGTK 2.10 and above.The get_width() method returns the
paper width of the paper size, in units of
unit.gtk.PaperSize.get_heightget_heightunitunit :the unit for the return value - one of the
.Returns :the paper heightThis method is available in PyGTK 2.10 and above.The get_height() method returns the
paper height of the paper size, in units of
unit.gtk.PaperSize.is_customis_customReturns :True if the paper size is a
custom paper size.The is_custom() method returns
True if paper size is not a standard paper
size.gtk.PaperSize.set_sizeset_sizewidthheightunitwidth :the new width in units of
unitheight :the new height in units of
unitunit :the unit for width and
height - one of the .This method is available in PyGTK 2.10 and above.The set_size() method changes the
dimensions of the paper size to width x
height in the units specified by
unit.gtk.PaperSize.get_default_top_marginget_default_top_marginunitunit :the unit for the return value - one of the
.Returns :the default top marginThis method is available in PyGTK 2.10 and above.The get_default_top_margin() method
returns the default top margin for the gtk.PaperSize.gtk.PaperSize.get_default_bottom_marginget_default_bottom_marginunitunit :the unit for the return value - one of the
.Returns :the default bottom marginThis method is available in PyGTK 2.10 and above.The get_default_bottom_margin() method
gets the default bottom margin for the paper size.gtk.PaperSize.get_default_left_marginget_default_left_marginunitunit :the unit for the return value - one of the
.Returns :the default left marginThis method is available in PyGTK 2.10 and above.The get_default_left_margin() method
gets the default left margin for the paper size.gtk.PaperSize.get_default_right_marginget_default_right_marginunitunit :the unit for the return value - one of the
.Returns :the default right marginThis method is available in PyGTK 2.10 and above.The get_default_right_margin() method
gets the default right margin for the paper size.Functionsgtk.paper_size_new_from_ppdgtk.paper_size_new_from_ppdppd_nameppd_display_namewidthheight>ppd_name :a PPD paper nameppd_display_name :the corresponding human-readable
namewidth :the paper width, in pointsheight :the paper height in pointsReturns :a new gtk.PaperSizeThis function is available in PyGTK 2.10 and above.The paper_size new__from_ppd() function
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.gtk.paper_size_new_customgtk.paper_size_new_customnamedisplay_namewidthheightunit>name :the paper namedisplay_name :the corresponding human-readable
namewidth :the paper width, in units of
unitheight :the paper height in units of
unitunit :the units - one of the .Returns :a new gtk.PaperSizeThis function is available in PyGTK 2.10 and above.The paper_size_new_custom() function
creates a new gtk.PaperSize
object with the given parameters.gtk.paper_size_get_defaultgtk.paper_size_get_defaultReturns :the name of the default paper
size.This function is available in PyGTK 2.10 and above.The paper_size_get_default() function
returns the name of the default paper size, which depends on the
current locale.