Gjsify LogoGjsify Logo

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][print-margins].

Printing support has been added in GTK+ 2.10.

record

Hierarchy

  • PaperSize

Index

Constructors

Properties

name: string

Methods

  • free(): void
  • get_default_bottom_margin(unit: Gtk.Unit): number
  • Gets the default bottom margin for the #GtkPaperSize.

    Parameters

    • unit: Gtk.Unit

      the unit for the return value, not %GTK_UNIT_NONE

    Returns number

  • get_default_left_margin(unit: Gtk.Unit): number
  • get_default_right_margin(unit: Gtk.Unit): number
  • get_default_top_margin(unit: Gtk.Unit): number
  • get_display_name(): string
  • Gets the paper height of the #GtkPaperSize, in units of unit.

    Parameters

    • unit: Gtk.Unit

      the unit for the return value, not %GTK_UNIT_NONE

    Returns number

  • get_name(): string
  • get_ppd_name(): string
  • Gets the paper width of the #GtkPaperSize, in units of unit.

    Parameters

    • unit: Gtk.Unit

      the unit for the return value, not %GTK_UNIT_NONE

    Returns number

  • is_custom(): boolean
  • is_ipp(): boolean
  • set_size(width: number, height: number, unit: Gtk.Unit): void
  • 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

  • to_key_file(key_file: GLib.KeyFile, group_name: string): void
  • This function adds the paper size from size to key_file.

    Parameters

    • key_file: GLib.KeyFile

      the #GKeyFile to save the paper size to

    • group_name: string

      the group to add the settings to in key_file

    Returns void

  • get_default(): 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[]

  • new_custom(name: string, display_name: string, width: number, height: number, unit: Gtk.Unit): Gtk.PaperSize
  • Creates a new #GtkPaperSize object with the given parameters.

    Parameters

    • name: string

      the paper name

    • display_name: string

      the human-readable name

    • width: number

      the paper width, in units of unit

    • height: number

      the paper height, in units of unit

    • unit: Gtk.Unit

      the unit for width and height. not %GTK_UNIT_NONE.

    Returns Gtk.PaperSize

  • new_from_ipp(ipp_name: string, width: number, height: number): Gtk.PaperSize
  • Creates a new #GtkPaperSize object by using IPP information.

    If ipp_name is not a recognized paper name, width and height are used to construct a custom #GtkPaperSize object.

    Parameters

    • ipp_name: string

      an IPP paper name

    • width: number

      the paper width, in points

    • height: number

      the paper height in points

    Returns Gtk.PaperSize

  • Reads a paper size from the group group_name in the key file key_file.

    Parameters

    • key_file: GLib.KeyFile

      the #GKeyFile to retrieve the papersize from

    • group_name: string

      the name of the group in the key file to read, or %NULL to read the first group

    Returns Gtk.PaperSize

  • new_from_ppd(ppd_name: string, ppd_display_name: string, width: number, height: number): Gtk.PaperSize
  • Creates a new #GtkPaperSize 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 #GtkPaperSize object.

    Parameters

    • ppd_name: string

      a PPD paper name

    • ppd_display_name: string

      the corresponding human-readable name

    • width: number

      the paper width, in points

    • height: number

      the paper height in points

    Returns Gtk.PaperSize

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method