.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.richtext.RichTextPrinting:

==========================================================================================================================================
|phoenix_title|  **wx.richtext.RichTextPrinting**
==========================================================================================================================================

This class provides a simple interface for performing :ref:`wx.richtext.RichTextBuffer`  printing and previewing.          

It uses :ref:`wx.richtext.RichTextPrintout`  for layout and rendering. 









|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>RichTextPrinting</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.richtext.RichTextPrinting_inheritance.png" alt="Inheritance diagram of RichTextPrinting" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.richtext.RichTextPrinting.html" title="wx.richtext.RichTextPrinting" alt="" coords="5,83,197,112"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="60,5,141,35"/> </map> 
   </p>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextPrinting.__init__`                                   Constructor.
:meth:`~wx.richtext.RichTextPrinting.GetFooterText`                              A convenience function to get the footer text.
:meth:`~wx.richtext.RichTextPrinting.GetHeaderFooterData`                        Returns the internal :ref:`wx.richtext.RichTextHeaderFooterData`  object.
:meth:`~wx.richtext.RichTextPrinting.GetHeaderText`                              A convenience function to get the header text.
:meth:`~wx.richtext.RichTextPrinting.GetPageSetupData`                           Returns a pointer to the internal page setup data.
:meth:`~wx.richtext.RichTextPrinting.GetParentWindow`                            Returns the parent window to be used for the preview window and printing wait dialog.
:meth:`~wx.richtext.RichTextPrinting.GetPreviewRect`                             Returns the dimensions to be used for the preview window.
:meth:`~wx.richtext.RichTextPrinting.GetPrintData`                               Returns a pointer to the internal print data.
:meth:`~wx.richtext.RichTextPrinting.GetTitle`                                   Returns the title of the preview window or printing wait caption.
:meth:`~wx.richtext.RichTextPrinting.PageSetup`                                  Shows the page setup dialog.
:meth:`~wx.richtext.RichTextPrinting.PreviewBuffer`                              Shows a preview window for the given buffer.
:meth:`~wx.richtext.RichTextPrinting.PreviewFile`                                Shows a preview window for the given file.
:meth:`~wx.richtext.RichTextPrinting.PrintBuffer`                                Prints the given buffer.
:meth:`~wx.richtext.RichTextPrinting.PrintFile`                                  Prints the given file.
:meth:`~wx.richtext.RichTextPrinting.SetFooterText`                              A convenience function to set the footer text.
:meth:`~wx.richtext.RichTextPrinting.SetHeaderFooterData`                        Sets the internal :ref:`wx.richtext.RichTextHeaderFooterData`  object.
:meth:`~wx.richtext.RichTextPrinting.SetHeaderFooterFont`                        Sets the :ref:`wx.richtext.RichTextHeaderFooterData`  font.
:meth:`~wx.richtext.RichTextPrinting.SetHeaderFooterTextColour`                  Sets the :ref:`wx.richtext.RichTextHeaderFooterData`  text colour.
:meth:`~wx.richtext.RichTextPrinting.SetHeaderText`                              A convenience function to set the header text.
:meth:`~wx.richtext.RichTextPrinting.SetPageSetupData`                           Sets the page setup data.
:meth:`~wx.richtext.RichTextPrinting.SetParentWindow`                            Sets the parent window to be used for the preview window and printing wait dialog.
:meth:`~wx.richtext.RichTextPrinting.SetPreviewRect`                             Sets the dimensions to be used for the preview window.
:meth:`~wx.richtext.RichTextPrinting.SetPrintData`                               Sets the print data.
:meth:`~wx.richtext.RichTextPrinting.SetShowOnFirstPage`                         Pass ``True`` to show the header and footer on the first page.
:meth:`~wx.richtext.RichTextPrinting.SetTitle`                                   Pass the title of the preview window or printing wait caption.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextPrinting.FooterText`                                 See :meth:`~wx.richtext.RichTextPrinting.GetFooterText` and :meth:`~wx.richtext.RichTextPrinting.SetFooterText`
:attr:`~wx.richtext.RichTextPrinting.HeaderFooterData`                           See :meth:`~wx.richtext.RichTextPrinting.GetHeaderFooterData` and :meth:`~wx.richtext.RichTextPrinting.SetHeaderFooterData`
:attr:`~wx.richtext.RichTextPrinting.HeaderText`                                 See :meth:`~wx.richtext.RichTextPrinting.GetHeaderText` and :meth:`~wx.richtext.RichTextPrinting.SetHeaderText`
:attr:`~wx.richtext.RichTextPrinting.PageSetupData`                              See :meth:`~wx.richtext.RichTextPrinting.GetPageSetupData` and :meth:`~wx.richtext.RichTextPrinting.SetPageSetupData`
:attr:`~wx.richtext.RichTextPrinting.ParentWindow`                               See :meth:`~wx.richtext.RichTextPrinting.GetParentWindow` and :meth:`~wx.richtext.RichTextPrinting.SetParentWindow`
:attr:`~wx.richtext.RichTextPrinting.PreviewRect`                                See :meth:`~wx.richtext.RichTextPrinting.GetPreviewRect` and :meth:`~wx.richtext.RichTextPrinting.SetPreviewRect`
:attr:`~wx.richtext.RichTextPrinting.PrintData`                                  See :meth:`~wx.richtext.RichTextPrinting.GetPrintData` and :meth:`~wx.richtext.RichTextPrinting.SetPrintData`
:attr:`~wx.richtext.RichTextPrinting.Title`                                      See :meth:`~wx.richtext.RichTextPrinting.GetTitle` and :meth:`~wx.richtext.RichTextPrinting.SetTitle`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.richtext.RichTextPrinting(Object)

   **Possible constructors**::

       RichTextPrinting(name="Printing", parentWindow=None)
       
   
   This class provides a simple interface for performing RichTextBuffer
   printing and previewing.



   .. method:: __init__(self, name="Printing", parentWindow=None)

      Constructor.                  

      Optionally pass a title to be used in the preview frame and printing wait dialog, and also a parent window for these windows.                  


      :param `name`: 
      :type `name`: string
      :param `parentWindow`: 
      :type `parentWindow`: wx.Window







   .. method:: GetFooterText(self, page=RICHTEXT_PAGE_EVEN, location=RICHTEXT_PAGE_CENTRE)

      A convenience function to get the footer text.                  

      See :ref:`wx.richtext.RichTextHeaderFooterData`  for details.                  


      :param `page`: 
      :type `page`: wx.richtext.RichTextOddEvenPage
      :param `location`: 
      :type `location`: wx.richtext.RichTextPageLocation




      :rtype: `string`








   .. method:: GetHeaderFooterData(self)

      Returns the internal :ref:`wx.richtext.RichTextHeaderFooterData`  object.                  

      :rtype: :ref:`wx.richtext.RichTextHeaderFooterData`








   .. method:: GetHeaderText(self, page=RICHTEXT_PAGE_EVEN, location=RICHTEXT_PAGE_CENTRE)

      A convenience function to get the header text.                  

      See :ref:`wx.richtext.RichTextHeaderFooterData`  for details.                  


      :param `page`: 
      :type `page`: wx.richtext.RichTextOddEvenPage
      :param `location`: 
      :type `location`: wx.richtext.RichTextPageLocation




      :rtype: `string`








   .. method:: GetPageSetupData(self)

      Returns a pointer to the internal page setup data.                  

      :rtype: :ref:`PageSetupDialogData`








   .. method:: GetParentWindow(self)

      Returns the parent window to be used for the preview window and printing wait dialog.                  

      :rtype: :ref:`Window`








   .. method:: GetPreviewRect(self)

      Returns the dimensions to be used for the preview window.                  

      :rtype: :ref:`Rect`








   .. method:: GetPrintData(self)

      Returns a pointer to the internal print data.                  

      :rtype: :ref:`PrintData`








   .. method:: GetTitle(self)

      Returns the title of the preview window or printing wait caption.                  

      :rtype: `string`








   .. method:: PageSetup(self)

      Shows the page setup dialog.                   





   .. method:: PreviewBuffer(self, buffer)

      Shows a preview window for the given buffer.                  

      The function takes its own copy of `buffer`.                  


      :param `buffer`: 
      :type `buffer`: wx.richtext.RichTextBuffer




      :rtype: `bool`








   .. method:: PreviewFile(self, richTextFile)

      Shows a preview window for the given file.                  

      `richTextFile`  can be a text file or ``XML`` file, or other file depending on the available file handlers.                  


      :param `richTextFile`: 
      :type `richTextFile`: string




      :rtype: `bool`








   .. method:: PrintBuffer(self, buffer, showPrintDialog=True)

      Prints the given buffer.                  

      The function takes its own copy of `buffer`. `showPrintDialog`  can be ``True`` to show the print dialog, or ``False`` to print quietly.                  


      :param `buffer`: 
      :type `buffer`: wx.richtext.RichTextBuffer
      :param `showPrintDialog`: 
      :type `showPrintDialog`: bool




      :rtype: `bool`








   .. method:: PrintFile(self, richTextFile, showPrintDialog=True)

      Prints the given file.                  

      `richTextFile`  can be a text file or ``XML`` file, or other file depending on the available file handlers. `showPrintDialog`  can be ``True`` to show the print dialog, or ``False`` to print quietly.                  


      :param `richTextFile`: 
      :type `richTextFile`: string
      :param `showPrintDialog`: 
      :type `showPrintDialog`: bool




      :rtype: `bool`








   .. method:: SetFooterText(self, text, page=RICHTEXT_PAGE_ALL, location=RICHTEXT_PAGE_CENTRE)

      A convenience function to set the footer text.                  

      See :ref:`wx.richtext.RichTextHeaderFooterData`  for details.                  


      :param `text`: 
      :type `text`: string
      :param `page`: 
      :type `page`: wx.richtext.RichTextOddEvenPage
      :param `location`: 
      :type `location`: wx.richtext.RichTextPageLocation







   .. method:: SetHeaderFooterData(self, data)

      Sets the internal :ref:`wx.richtext.RichTextHeaderFooterData`  object.                  


      :param `data`: 
      :type `data`: wx.richtext.RichTextHeaderFooterData







   .. method:: SetHeaderFooterFont(self, font)

      Sets the :ref:`wx.richtext.RichTextHeaderFooterData`  font.                  


      :param `font`: 
      :type `font`: wx.Font







   .. method:: SetHeaderFooterTextColour(self, colour)

      Sets the :ref:`wx.richtext.RichTextHeaderFooterData`  text colour.                  


      :param `colour`: 
      :type `colour`: wx.Colour







   .. method:: SetHeaderText(self, text, page=RICHTEXT_PAGE_ALL, location=RICHTEXT_PAGE_CENTRE)

      A convenience function to set the header text.                  

      See :ref:`wx.richtext.RichTextHeaderFooterData`  for details.                  


      :param `text`: 
      :type `text`: string
      :param `page`: 
      :type `page`: wx.richtext.RichTextOddEvenPage
      :param `location`: 
      :type `location`: wx.richtext.RichTextPageLocation







   .. method:: SetPageSetupData(self, pageSetupData)

      Sets the page setup data.                  


      :param `pageSetupData`: 
      :type `pageSetupData`: wx.PageSetupDialogData







   .. method:: SetParentWindow(self, parent)

      Sets the parent window to be used for the preview window and printing wait dialog.                  


      :param `parent`: 
      :type `parent`: wx.Window







   .. method:: SetPreviewRect(self, rect)

      Sets the dimensions to be used for the preview window.                  


      :param `rect`: 
      :type `rect`: wx.Rect







   .. method:: SetPrintData(self, printData)

      Sets the print data.                  


      :param `printData`: 
      :type `printData`: wx.PrintData







   .. method:: SetShowOnFirstPage(self, show)

      Pass ``True`` to show the header and footer on the first page.                  


      :param `show`: 
      :type `show`: bool







   .. method:: SetTitle(self, title)

      Pass the title of the preview window or printing wait caption.                  


      :param `title`: 
      :type `title`: string







   .. attribute:: FooterText

      See :meth:`~wx.richtext.RichTextPrinting.GetFooterText` and :meth:`~wx.richtext.RichTextPrinting.SetFooterText`


   .. attribute:: HeaderFooterData

      See :meth:`~wx.richtext.RichTextPrinting.GetHeaderFooterData` and :meth:`~wx.richtext.RichTextPrinting.SetHeaderFooterData`


   .. attribute:: HeaderText

      See :meth:`~wx.richtext.RichTextPrinting.GetHeaderText` and :meth:`~wx.richtext.RichTextPrinting.SetHeaderText`


   .. attribute:: PageSetupData

      See :meth:`~wx.richtext.RichTextPrinting.GetPageSetupData` and :meth:`~wx.richtext.RichTextPrinting.SetPageSetupData`


   .. attribute:: ParentWindow

      See :meth:`~wx.richtext.RichTextPrinting.GetParentWindow` and :meth:`~wx.richtext.RichTextPrinting.SetParentWindow`


   .. attribute:: PreviewRect

      See :meth:`~wx.richtext.RichTextPrinting.GetPreviewRect` and :meth:`~wx.richtext.RichTextPrinting.SetPreviewRect`


   .. attribute:: PrintData

      See :meth:`~wx.richtext.RichTextPrinting.GetPrintData` and :meth:`~wx.richtext.RichTextPrinting.SetPrintData`


   .. attribute:: Title

      See :meth:`~wx.richtext.RichTextPrinting.GetTitle` and :meth:`~wx.richtext.RichTextPrinting.SetTitle`

