## GtkPrintContext GtkPrintContext |

## Functions

cairo_t * | gtk_print_context_get_cairo_context ()
void | gtk_print_context_set_cairo_context ()
GtkPageSetup * | gtk_print_context_get_page_setup ()
gdouble | gtk_print_context_get_width ()
gdouble | gtk_print_context_get_height ()
gdouble | gtk_print_context_get_dpi_x ()
gdouble | gtk_print_context_get_dpi_y ()
PangoFontMap * | gtk_print_context_get_pango_fontmap ()
PangoContext * | gtk_print_context_create_pango_context ()
PangoLayout * | gtk_print_context_create_pango_layout ()
gboolean | gtk_print_context_get_hard_margins ()

## Types and Values

| GtkPrintContext

## Object Hierarchy

        GObject
        ╰── GtkPrintContext

## Includes

    #include <gtk/gtkprintunixdialog.h>

## Description

## Functions

### gtk_print_context_get_cairo_context ()

    cairo_t *
    gtk_print_context_get_cairo_context (GtkPrintContext *context);

Obtains the cairo context that is associated with the GtkPrintContext.

#### Parameters

context | a GtkPrintContext |

#### Returns

the cairo context of `context` .

[transfer none]

Since: 2.10

### gtk_print_context_set_cairo_context ()

    void
    gtk_print_context_set_cairo_context (GtkPrintContext *context,
                                         cairo_t *cr,
                                         double dpi_x,
                                         double dpi_y);

Sets a new cairo context on a print context.

This function is intended to be used when implementing an internal print preview, it is not needed for printing, since GTK+ itself creates a suitable cairo context in that case.

#### Parameters

context | a GtkPrintContext |
cr | the cairo context |
dpi_x | the horizontal resolution to use with `cr` |
dpi_y | the vertical resolution to use with `cr` |

Since: 2.10

### gtk_print_context_get_page_setup ()

    GtkPageSetup *
    gtk_print_context_get_page_setup (GtkPrintContext *context);

Obtains the GtkPageSetup that determines the page dimensions of the GtkPrintContext.

#### Parameters

context | a GtkPrintContext |

#### Returns

the page setup of `context` .

[transfer none]

Since: 2.10

### gtk_print_context_get_width ()

    gdouble
    gtk_print_context_get_width (GtkPrintContext *context);

Obtains the width of the GtkPrintContext, in pixels.

#### Parameters

context | a GtkPrintContext |

#### Returns

the width of `context`

Since: 2.10

### gtk_print_context_get_height ()

    gdouble
    gtk_print_context_get_height (GtkPrintContext *context);

Obtains the height of the GtkPrintContext, in pixels.

#### Parameters

context | a GtkPrintContext |

#### Returns

the height of `context`

Since: 2.10

### gtk_print_context_get_dpi_x ()

    gdouble
    gtk_print_context_get_dpi_x (GtkPrintContext *context);

Obtains the horizontal resolution of the GtkPrintContext, in dots per inch.

#### Parameters

context | a GtkPrintContext |

#### Returns

the horizontal resolution of `context`

Since: 2.10

### gtk_print_context_get_dpi_y ()

    gdouble
    gtk_print_context_get_dpi_y (GtkPrintContext *context);

Obtains the vertical resolution of the GtkPrintContext, in dots per inch.

#### Parameters

context | a GtkPrintContext |

#### Returns

the vertical resolution of `context`

Since: 2.10

### gtk_print_context_get_pango_fontmap ()

    PangoFontMap *
    gtk_print_context_get_pango_fontmap (GtkPrintContext *context);

Returns a PangoFontMap that is suitable for use with the GtkPrintContext.

#### Parameters

context | a GtkPrintContext |

#### Returns

the font map of `context` .

[transfer none]

Since: 2.10

### gtk_print_context_create_pango_context ()

    PangoContext *
    gtk_print_context_create_pango_context
                                   (GtkPrintContext *context);

Creates a new PangoContext that can be used with the GtkPrintContext.

#### Parameters

context | a GtkPrintContext |

#### Returns

a new Pango context for `context` .

[transfer full]

Since: 2.10

### gtk_print_context_create_pango_layout ()

    PangoLayout *
    gtk_print_context_create_pango_layout (GtkPrintContext *context);

Creates a new PangoLayout that is suitable for use with the GtkPrintContext.

#### Parameters

context | a GtkPrintContext |

#### Returns

a new Pango layout for `context` .

[transfer full]

Since: 2.10

### gtk_print_context_get_hard_margins ()

    gboolean
    gtk_print_context_get_hard_margins (GtkPrintContext *context,
                                        gdouble *top,
                                        gdouble *bottom,
                                        gdouble *left,
                                        gdouble *right);

Obtains the hardware printer margins of the GtkPrintContext, in units.

#### Parameters

context | a GtkPrintContext |
top | top hardware printer margin. | [out]
bottom | bottom hardware printer margin. | [out]
left | left hardware printer margin. | [out]
right | right hardware printer margin. | [out]

#### Returns

`TRUE` if the hard margins were retrieved

Since: 2.20

## Types and Values

### GtkPrintContext

    typedef struct _GtkPrintContext GtkPrintContext;