gtk.paper_size
Module for [PaperSize] class
class PaperSize
Types 1
classPaperSize : gobject.boxed.Boxed
gtk.paper_size.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.paper_size.PaperSize allows to construct custom paper sizes with arbitrary dimensions.
The gtk.paper_size.PaperSize object stores not only the dimensions (width and height) of a paper size and its name, it also provides default print margins.
Methods
gtk.paper_size.PaperSize newCustom(string name, string displayName, double width, double height, gtk.types.Unit unit) static nothrowCreates a new [gtk.paper_size.PaperSize] object with the given parameters.gtk.paper_size.PaperSize newFromGvariant(glib.variant.Variant variant) static nothrowDeserialize a paper size from a [glib.variant.Variant].gtk.paper_size.PaperSize newFromIpp(string ippName, double width, double height) static nothrowCreates a new [gtk.paper_size.PaperSize] object by using IPP information.gtk.paper_size.PaperSize newFromKeyFile(glib.key_file.KeyFile keyFile, string groupName = null) staticReads a paper size from the group group_name in the key file key_file.gtk.paper_size.PaperSize newFromPpd(string ppdName, string ppdDisplayName, double width, double height) static nothrowCreates a new [gtk.paper_size.PaperSize] object by using PPD information.gtk.paper_size.PaperSize copy() nothrowCopies an existing [gtk.paper_size.PaperSize]. Returns: a copy of otherdouble getDefaultBottomMargin(gtk.types.Unit unit) nothrowGets the default bottom margin for the [gtk.paper_size.PaperSize].double getDefaultLeftMargin(gtk.types.Unit unit) nothrowGets the default left margin for the [gtk.paper_size.PaperSize].double getDefaultRightMargin(gtk.types.Unit unit) nothrowGets the default right margin for the [gtk.paper_size.PaperSize].double getDefaultTopMargin(gtk.types.Unit unit) nothrowGets the default top margin for the [gtk.paper_size.PaperSize].string getDisplayName() nothrowGets the human-readable name of the [gtk.paper_size.PaperSize]. Returns: the human-readable name of sizedouble getHeight(gtk.types.Unit unit) nothrowGets the paper height of the [gtk.paper_size.PaperSize], in units of unit.string getPpdName() nothrowGets the PPD name of the [gtk.paper_size.PaperSize], which may be null. Returns: the PPD name of sizedouble getWidth(gtk.types.Unit unit) nothrowGets the paper width of the [gtk.paper_size.PaperSize], in units of unit.bool isCustom() nothrowReturns true if size is not a standard paper size. Returns: whether size is a custom paper size.bool isEqual(gtk.paper_size.PaperSize size2) nothrowCompares two [gtk.paper_size.PaperSize] objects.bool isIpp() nothrowReturns true if size is an IPP standard paper size. Returns: whether size is not an IPP custom paper size.void setSize(double width, double height, gtk.types.Unit unit) nothrowChanges the dimensions of a size to width x height.glib.variant.Variant toGvariant() nothrowSerialize a paper size to an `a{sv}` variant. Returns: a new, floating, [glib.variant.Variant]void toKeyFile(glib.key_file.KeyFile keyFile, string groupName) nothrowThis function adds the paper size from size to key_file.string getDefault() static nothrowReturns the name of the default paper size, which depends on the current locale. Returns: the name of the default paper size. The string is owned by GTK and should not be modified.gtk.paper_size.PaperSize[] getPaperSizes(bool includeCustom) static nothrowCreates a list of known paper sizes.