:right-sidebar: True PrintOperationPreview =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: PrintOperationPreview(*args, **kwargs) :no-contents-entry: Implementations: :class:`~gi.repository.Gtk.PrintOperation` ``GtkPrintOperationPreview`` is the interface that is used to implement print preview. A ``GtkPrintOperationPreview`` object is passed to the :obj:`~gi.repository.Gtk.PrintOperation.signals.preview` signal by :obj:`~gi.repository.Gtk.PrintOperation`\. Methods ------- .. rst-class:: interim-class .. class:: PrintOperationPreview :no-index: .. method:: end_preview() -> None Ends a preview. This function must be called to finish a custom print preview. .. method:: is_selected(page_nr: int) -> bool Returns whether the given page is included in the set of pages that have been selected for printing. :param page_nr: a page number .. method:: render_page(page_nr: int) -> None Renders a page to the preview. This is using the print context that was passed to the :obj:`~gi.repository.Gtk.PrintOperation.signals.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. :param page_nr: the page to render Signals ------- .. rst-class:: interim-class .. class:: PrintOperationPreview.signals :no-index: .. method:: got_page_size(context: ~gi.repository.Gtk.PrintContext, page_setup: ~gi.repository.Gtk.PageSetup) -> None The type of the None singleton. :param context: the current ``GtkPrintContext`` :param page_setup: the ``GtkPageSetup`` for the current page .. method:: ready(context: ~gi.repository.Gtk.PrintContext) -> None The type of the None singleton. :param context: the current ``GtkPrintContext`` Virtual Methods --------------- .. rst-class:: interim-class .. class:: PrintOperationPreview :no-index: .. method:: do_end_preview() -> None Ends a preview. This function must be called to finish a custom print preview. .. method:: do_got_page_size(context: ~gi.repository.Gtk.PrintContext, page_setup: ~gi.repository.Gtk.PageSetup) -> None The type of the None singleton. :param context: :param page_setup: .. method:: 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. :param page_nr: a page number .. method:: do_ready(context: ~gi.repository.Gtk.PrintContext) -> None The type of the None singleton. :param context: .. method:: do_render_page(page_nr: int) -> None Renders a page to the preview. This is using the print context that was passed to the :obj:`~gi.repository.Gtk.PrintOperation.signals.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. :param page_nr: the page to render