Class (GI Struct)

Gtk-4.0GtkPaperSize

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). 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.

Index

Constructors

Properties

Methods

  • Returns true if size is not a standard paper size.

    Returns boolean

    whether size is a custom paper size.

  • Returns true if size is an IPP standard paper size.

    Returns boolean

    whether size is not an IPP custom paper size.

  • Changes the dimensions of a size to width x height.

    Parameters

    • width: number

      the new width in units of unit

    • height: number

      the new height in units of unit

    • unit: Gtk.Unit

      the unit for width and height

    Returns void

  • This function adds the paper size from size to key_file.

    Parameters

    • key_file: GLib.KeyFile

      the GLib.KeyFile to save the paper size to

    • group_name: string

      the group to add the settings to in key_file

    Returns void

  • Returns the name of the default paper size, which depends on the current locale.

    Returns string

  • Creates a list of known paper sizes.

    Parameters

    • include_custom: boolean

      whether to include custom paper sizes as defined in the page setup dialog

    Returns Gtk.PaperSize[]

  • Parameters

    • ppd_name: string
    • ppd_display_name: string
    • width: number
    • height: number

    Returns Gtk.PaperSize