Gtk.PaperSize¶
Fields¶
None
Methods¶
| class | get_default() | 
| class | get_paper_sizes(include_custom) | 
| class | new(name) | 
| class | new_custom(name, display_name, width, height, unit) | 
| class | new_from_gvariant(variant) | 
| class | new_from_ipp(ipp_name, width, height) | 
| class | new_from_key_file(key_file, group_name) | 
| class | new_from_ppd(ppd_name, ppd_display_name, width, height) | 
| copy() | |
| free() | |
| get_default_bottom_margin(unit) | |
| get_default_left_margin(unit) | |
| get_default_right_margin(unit) | |
| get_default_top_margin(unit) | |
| get_display_name() | |
| get_height(unit) | |
| get_name() | |
| get_ppd_name() | |
| get_width(unit) | |
| is_custom() | |
| is_equal(size2) | |
| is_ipp() | |
| set_size(width, height, unit) | |
| to_gvariant() | |
| to_key_file(key_file, group_name) | 
Details¶
- 
class Gtk.PaperSize¶
- Gtk.PaperSizehandles 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.PaperSizeallows to construct custom paper sizes with arbitrary dimensions.- The - Gtk.PaperSizeobject stores not only the dimensions (width and height) of a paper size and its name, it also provides default print margins.- Printing support has been added in GTK+ 2.10. - 
classmethod get_default()[source]¶
- Returns: - the name of the default paper size. The string is owned by GTK+ and should not be modified. - Return type: - str- Returns the name of the default paper size, which depends on the current locale. - New in version 2.10. 
 - 
classmethod get_paper_sizes(include_custom)[source]¶
- Parameters: - include_custom ( - bool) – whether to include custom paper sizes as defined in the page setup dialog- Returns: - a newly allocated list of newly allocated - Gtk.PaperSizeobjects- Return type: - [ - Gtk.PaperSize]- Creates a list of known paper sizes. - New in version 2.12. 
 - 
classmethod new(name)[source]¶
- Parameters: - name ( - stror- None) – a paper size name, or- None- Returns: - a new - Gtk.PaperSize, use- Gtk.PaperSize.free() to free it- Return type: - Gtk.PaperSize- Creates a new - Gtk.PaperSizeobject by parsing a PWG 5101.1-2002 paper name.- If name is - None, the default paper size is returned, see- Gtk.PaperSize.get_default().- New in version 2.10. 
 - 
classmethod new_custom(name, display_name, width, height, unit)[source]¶
- Parameters: - Returns: - a new - Gtk.PaperSizeobject, use- Gtk.PaperSize.free() to free it- Return type: - Creates a new - Gtk.PaperSizeobject with the given parameters.- New in version 2.10. 
 - 
classmethod new_from_gvariant(variant)[source]¶
- Parameters: - variant ( - GLib.Variant) – an a{sv}- GLib.Variant- Returns: - a new - Gtk.PaperSizeobject- Return type: - Gtk.PaperSize- Deserialize a paper size from an a{sv} variant in the format produced by - Gtk.PaperSize.to_gvariant().- New in version 3.22. 
 - 
classmethod new_from_ipp(ipp_name, width, height)[source]¶
- Parameters: - Returns: - a new - Gtk.PaperSize, use- Gtk.PaperSize.free() to free it- Return type: - Creates a new - Gtk.PaperSizeobject by using IPP information.- If ipp_name is not a recognized paper name, width and height are used to construct a custom - Gtk.PaperSizeobject.- New in version 3.16. 
 - 
classmethod new_from_key_file(key_file, group_name)[source]¶
- Parameters: - key_file (GLib.KeyFile) – theGLib.KeyFileto retrieve the papersize from
- group_name (strorNone) – the name of the group in the key file to read, orNoneto read the first group
 - Raises: - Returns: - a new - Gtk.PaperSizeobject with the restored paper size, or- Noneif an error occurred- Return type: - Reads a paper size from the group group_name in the key file key_file. - New in version 2.12. 
- key_file (
 - 
classmethod new_from_ppd(ppd_name, ppd_display_name, width, height)[source]¶
- Parameters: - Returns: - a new - Gtk.PaperSize, use- Gtk.PaperSize.free() to free it- Return type: - Creates a new - Gtk.PaperSizeobject 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.PaperSizeobject.- New in version 2.10. 
 - 
copy()[source]¶
- Returns: - a copy of self - Return type: - Gtk.PaperSize- Copies an existing - Gtk.PaperSize.- New in version 2.10. 
 - 
free()[source]¶
- Free the given - Gtk.PaperSizeobject.- New in version 2.10. 
 - 
get_default_bottom_margin(unit)[source]¶
- Parameters: - unit ( - Gtk.Unit) – the unit for the return value, not- Gtk.Unit.NONE- Returns: - the default bottom margin - Return type: - float- Gets the default bottom margin for the - Gtk.PaperSize.- New in version 2.10. 
 - 
get_default_left_margin(unit)[source]¶
- Parameters: - unit ( - Gtk.Unit) – the unit for the return value, not- Gtk.Unit.NONE- Returns: - the default left margin - Return type: - float- Gets the default left margin for the - Gtk.PaperSize.- New in version 2.10. 
 - 
get_default_right_margin(unit)[source]¶
- Parameters: - unit ( - Gtk.Unit) – the unit for the return value, not- Gtk.Unit.NONE- Returns: - the default right margin - Return type: - float- Gets the default right margin for the - Gtk.PaperSize.- New in version 2.10. 
 - 
get_default_top_margin(unit)[source]¶
- Parameters: - unit ( - Gtk.Unit) – the unit for the return value, not- Gtk.Unit.NONE- Returns: - the default top margin - Return type: - float- Gets the default top margin for the - Gtk.PaperSize.- New in version 2.10. 
 - 
get_display_name()[source]¶
- Returns: - the human-readable name of self - Return type: - str- Gets the human-readable name of the - Gtk.PaperSize.- New in version 2.10. 
 - 
get_height(unit)[source]¶
- Parameters: - unit ( - Gtk.Unit) – the unit for the return value, not- Gtk.Unit.NONE- Returns: - the paper height - Return type: - float- Gets the paper height of the - Gtk.PaperSize, in units of unit.- New in version 2.10. 
 - 
get_name()[source]¶
- Returns: - the name of self - Return type: - str- Gets the name of the - Gtk.PaperSize.- New in version 2.10. 
 - 
get_ppd_name()[source]¶
- Returns: - the PPD name of self - Return type: - str- Gets the PPD name of the - Gtk.PaperSize, which may be- None.- New in version 2.10. 
 - 
get_width(unit)[source]¶
- Parameters: - unit ( - Gtk.Unit) – the unit for the return value, not- Gtk.Unit.NONE- Returns: - the paper width - Return type: - float- Gets the paper width of the - Gtk.PaperSize, in units of unit.- New in version 2.10. 
 - 
is_custom()[source]¶
- Returns: - whether self is a custom paper size. - Return type: - bool- Returns - Trueif self is not a standard paper size.
 - 
is_equal(size2)[source]¶
- Parameters: - size2 ( - Gtk.PaperSize) – another- Gtk.PaperSizeobject- Returns: - True, if self and size2 represent the same paper size- Return type: - bool- Compares two - Gtk.PaperSizeobjects.- New in version 2.10. 
 - 
is_ipp()[source]¶
- Returns: - whether self is not an IPP custom paper size. - Return type: - bool- Returns - Trueif self is an IPP standard paper size.
 - 
set_size(width, height, unit)[source]¶
- Parameters: - Changes the dimensions of a self to width x height. - New in version 2.10. 
 - 
to_gvariant()[source]¶
- Returns: - a new, floating, - GLib.Variant- Return type: - GLib.Variant- Serialize a paper size to an a{sv} variant. - New in version 3.22. 
 - 
to_key_file(key_file, group_name)[source]¶
- Parameters: - key_file (GLib.KeyFile) – theGLib.KeyFileto save the paper size to
- group_name (str) – the group to add the settings to in key_file
 - This function adds the paper size from self to key_file. - New in version 2.12. 
- key_file (
 
- 
classmethod