PaperSize
Object Hierarchy:
Gtk.PaperSize
Gtk.PaperSize
Gtk.PaperSize
Description:
[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "gtk_paper_size_get_type ()" ) ] [ Compact ]public class PaperSize
`GtkPaperSize` 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,
`GtkPaperSize` allows to construct custom paper sizes with arbitrary dimensions.
The `GtkPaperSize` object stores not only the dimensions (width and height) of a paper size and its name, it also provides default print
margins.
Content:
Static methods:
Creation methods:
public PaperSize (string ? name)
Creates a new `GtkPaperSize` object by parsing a [PWG 5101.1-2002](
ftp://ftp.
public PaperSize.custom (string name, string display_name, double width, double height, Unit unit)
Creates a new `GtkPaperSize` object with the given parameters.
public PaperSize.from_gvariant (Variant variant)
Deserialize a paper size from a `GVariant`.
public PaperSize.from_ipp (string ipp_name, double width, double height)
Creates a new `GtkPaperSize` object by using IPP information.
public PaperSize.from_key_file (KeyFile key_file, string ? group_name) throws Error
Reads a paper size from the group group_name
in the key
file key_file
.
public PaperSize.from_ppd (string ppd_name, string ppd_display_name, double width, double height)
Creates a new `GtkPaperSize` object by using PPD information.
Methods:
public PaperSize copy ()
Copies an existing `GtkPaperSize`.
public void free ()
Free the given `GtkPaperSize` object.
public double get_default_bottom_margin (Unit unit)
Gets the default bottom margin for the `GtkPaperSize`.
public double get_default_left_margin (Unit unit)
Gets the default left margin for the `GtkPaperSize`.
public double get_default_right_margin (Unit unit)
Gets the default right margin for the `GtkPaperSize`.
public double get_default_top_margin (Unit unit)
Gets the default top margin for the `GtkPaperSize`.
public unowned string get_display_name ()
Gets the human-readable name of the `GtkPaperSize`.
public double get_height (Unit unit)
Gets the paper height of the `GtkPaperSize`, in units of unit
.
public unowned string get_name ()
Gets the name of the `GtkPaperSize`.
public unowned string get_ppd_name ()
Gets the PPD name of the `GtkPaperSize`, which may be
null .
public double get_width (Unit unit)
Gets the paper width of the `GtkPaperSize`, in units of unit
.
public bool is_custom ()
Returns true if
this is not a standard paper size.
public bool is_equal (PaperSize size2)
Compares two `GtkPaperSize` objects.
public bool is_ipp ()
Returns true if
this is an IPP standard paper size.
public void set_size (double width, double height, Unit unit)
Changes the dimensions of a this to
width
x height
.
public Variant to_gvariant ()
Serialize a paper size to an `a{sv}` variant.
public void to_key_file (KeyFile key_file, string group_name)
This function adds the paper size from this
to key_file
.