GtkSource.PrintCompositor.draw_page

### Method

# GtkSource PrintCompositordraw_page

#### Declaration [src]

    void
    gtk_source_print_compositor_draw_page (
      GtkSourcePrintCompositor* compositor,
      GtkPrintContext* context,
      gint page_nr
    )

#### Description [src]

Draw page `page_nr` for printing on the the Cairo context encapsuled in `context`.

This method has been designed to be called in the handler of the `GtkPrintOperation::draw-page` signal as shown in the following example:

    // Signal handler for the GtkPrintOperation::draw_page signal

    static void
    draw_page (GtkPrintOperation *operation,
               GtkPrintContext   *context,
               gint               page_nr,
               gpointer           user_data)
    {
        GtkSourcePrintCompositor *compositor;

        compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);

        gtk_source_print_compositor_draw_page (compositor,
                                               context,
                                               page_nr);
    }

    def on_draw_page(
        operation: Gtk.PrintOperation,
        context: Gtk.PrintContext,
        page_nr: int,
        compositor: GtkSource.PrintCompositor,
    ) -> None:
        """Signal handler for draw-page that renders a single page."""
        compositor.draw_page(context=context, page_nr=page_nr)

#### Parameters

`context`

  Type: `GtkPrintContext`

  The `GtkPrintContext` encapsulating the context information that is required when drawing the page for printing.

  The data is owned by the caller of the method.

`page_nr`

  Type: `gint`

  The number of the page to print.