gtk.PaperSize — an object providing support for named paper sizes (new in PyGTK 2.10)
class gtk.PaperSize(gobject.GBoxed): |
Functions |
This 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 GTK Papaer Name Constants. 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.
|
name : | a paper size name, or None |
Returns : | 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().
|
Returns : | a copy of other |
This method is available in PyGTK 2.10 and above.
The copy() method copies an existing gtk.PaperSize.
|
size2 : | another gtk.PaperSize object |
Returns : | TRUE, if this paper size and size2 represent the same paper size |
This 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.
|
Returns : | the name of the paper size |
This method is available in PyGTK 2.10 and above.
The get_name() method returns the name of the paper size.
|
Returns : | 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.
|
Returns : | the PPD name of the paper size or None |
This 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.
|
unit : | the unit for the return value - one of the GTK Unit Constants. |
Returns : | the paper width |
This 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.
|
unit : | the unit for the return value - one of the GTK Unit Constants. |
Returns : | the paper height |
This 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.
|
Returns : | 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.
|
width : | the new width in units of unit |
height : | the new height in units of unit |
unit : | the unit for width and height - one of the GTK Unit Constants. |
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.
|
unit : | the unit for the return value - one of the GTK Unit Constants. |
Returns : | the default top margin |
This method is available in PyGTK 2.10 and above.
The get_default_top_margin() method returns the default top margin for the gtk.PaperSize.
|
unit : | the unit for the return value - one of the GTK Unit Constants. |
Returns : | the default bottom margin |
This method is available in PyGTK 2.10 and above.
The get_default_bottom_margin() method gets the default bottom margin for the paper size.
|
unit : | the unit for the return value - one of the GTK Unit Constants. |
Returns : | the default left margin |
This method is available in PyGTK 2.10 and above.
The get_default_left_margin() method gets the default left margin for the paper size.
|
unit : | the unit for the return value - one of the GTK Unit Constants. |
Returns : | the default right margin |
This method is available in PyGTK 2.10 and above.
The get_default_right_margin() method gets the default right margin for the paper size.
|
>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 |
This 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.
|
>name : | the paper name |
display_name : | the corresponding human-readable name |
width : | the paper width, in units of unit |
height : | the paper height in units of unit |
unit : | the units - one of the GTK Unit Constants. |
Returns : | a new gtk.PaperSize |
This 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.