PrintOperationPreview#

class PrintOperationPreview(*args, **kwargs)#

Implementations: PrintOperation

GtkPrintOperationPreview is the interface that is used to implement print preview.

A GtkPrintOperationPreview object is passed to the preview signal by PrintOperation.

Methods#

class PrintOperationPreview
end_preview() None#

Ends a preview.

This function must be called to finish a custom print preview.

is_selected(page_nr: int) bool#

Returns whether the given page is included in the set of pages that have been selected for printing.

Parameters:

page_nr – a page number

render_page(page_nr: int) None#

Renders a page to the preview.

This is using the print context that was passed to the preview handler together with preview.

A custom print preview should use this function to render the currently selected page.

Note that this function requires a suitable cairo context to be associated with the print context.

Parameters:

page_nr – the page to render

Signals#

class PrintOperationPreview.signals
got_page_size(context: PrintContext, page_setup: PageSetup) None#

The type of the None singleton.

Parameters:
  • context – the current GtkPrintContext

  • page_setup – the GtkPageSetup for the current page

ready(context: PrintContext) None#

The type of the None singleton.

Parameters:

context – the current GtkPrintContext

Virtual Methods#

class PrintOperationPreview
do_end_preview() None#

Ends a preview.

This function must be called to finish a custom print preview.

do_got_page_size(context: PrintContext, page_setup: PageSetup) None#

The type of the None singleton.

Parameters:
  • context

  • page_setup

do_is_selected(page_nr: int) bool#

Returns whether the given page is included in the set of pages that have been selected for printing.

Parameters:

page_nr – a page number

do_ready(context: PrintContext) None#

The type of the None singleton.

Parameters:

context

do_render_page(page_nr: int) None#

Renders a page to the preview.

This is using the print context that was passed to the preview handler together with preview.

A custom print preview should use this function to render the currently selected page.

Note that this function requires a suitable cairo context to be associated with the print context.

Parameters:

page_nr – the page to render