## wxRichTextPrinting

This class provides a simple interface for performing wxRichTextBuffer printing and previewing. It uses wxRichTextPrintout for layout and rendering. Derived from

wxObject

Include files

<wx/richtext/richtextprint.h>

Data structures

Members

wxRichTextPrinting::wxRichTextPrinting
wxRichTextPrinting::GetFooterText
wxRichTextPrinting::GetHeaderFooterData
wxRichTextPrinting::GetHeaderText
wxRichTextPrinting::GetPageSetupData
wxRichTextPrinting::GetParentWindow
wxRichTextPrinting::GetPreviewRect
wxRichTextPrinting::GetPrintData
wxRichTextPrinting::GetTitle
wxRichTextPrinting::PageSetup
wxRichTextPrinting::PreviewBuffer
wxRichTextPrinting::PreviewFile
wxRichTextPrinting::PrintBuffer
wxRichTextPrinting::PrintFile
wxRichTextPrinting::SetFooterText
wxRichTextPrinting::SetHeaderFooterData
wxRichTextPrinting::SetHeaderFooterFont
wxRichTextPrinting::SetHeaderFooterTextColour
wxRichTextPrinting::SetHeaderText
wxRichTextPrinting::SetPageSetupData
wxRichTextPrinting::SetParentWindow
wxRichTextPrinting::SetPreviewRect
wxRichTextPrinting::SetPrintData
wxRichTextPrinting::SetShowOnFirstPage
wxRichTextPrinting::SetTitle

### wxRichTextPrinting::wxRichTextPrinting

wxRichTextPrinting(const wxString& name = wxT("Printing"), wxWindow* parentWindow = NULL)

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

### wxRichTextPrinting::GetFooterText

wxString GetFooterText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const

A convenience function to get the footer text. See wxRichTextHeaderFooterData for details.

### wxRichTextPrinting::GetHeaderFooterData

const wxRichTextHeaderFooterData& GetHeaderFooterData() const

Returns the internal wxRichTextHeaderFooterData object.

### wxRichTextPrinting::GetHeaderText

wxString GetHeaderText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const

A convenience function to get the header text. See wxRichTextHeaderFooterData for details.

### wxRichTextPrinting::GetPageSetupData

wxPageSetupDialogData* GetPageSetupData()

Returns a pointer to the internal page setup data.

### wxRichTextPrinting::GetParentWindow

wxWindow* GetParentWindow() const

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

### wxRichTextPrinting::GetPreviewRect

const wxRect& GetPreviewRect() const

Returns the dimensions to be used for the preview window.

### wxRichTextPrinting::GetPrintData

wxPrintData* GetPrintData()

Returns a pointer to the internal print data.

### wxRichTextPrinting::GetTitle

const wxString& GetTitle() const

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

### wxRichTextPrinting::PageSetup

void PageSetup()

Shows the page setup dialog.

### wxRichTextPrinting::PreviewBuffer

bool PreviewBuffer(const wxRichTextBuffer& buffer)

Shows a preview window for the given buffer. The function takes its own copy of buffer.

### wxRichTextPrinting::PreviewFile

bool PreviewFile(const wxString& 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.

### wxRichTextPrinting::PrintBuffer

bool PrintBuffer(const wxRichTextBuffer& buffer)

Prints the given buffer. The function takes its own copy of buffer.

### wxRichTextPrinting::PrintFile

bool PrintFile(const wxString& richTextFile)

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

### wxRichTextPrinting::SetFooterText

void SetFooterText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE)

A convenience function to set the footer text. See wxRichTextHeaderFooterData for details.

### wxRichTextPrinting::SetHeaderFooterData

void SetHeaderFooterData(const wxRichTextHeaderFooterData& data)

Sets the internal wxRichTextHeaderFooterData object.

### wxRichTextPrinting::SetHeaderFooterFont

void SetHeaderFooterFont(const wxFont& font)

Sets the wxRichTextHeaderFooterData font.

### wxRichTextPrinting::SetHeaderFooterTextColour

void SetHeaderFooterTextColour(const wxColour& colour)

Sets the wxRichTextHeaderFooterData text colour.

### wxRichTextPrinting::SetHeaderText

void SetHeaderText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE)

A convenience function to set the header text. See wxRichTextHeaderFooterData for details.

### wxRichTextPrinting::SetPageSetupData

void SetPageSetupData(const wxPageSetupData& pageSetupData)

Sets the page setup data.

### wxRichTextPrinting::SetParentWindow

void SetParentWindow(wxWindow* parent)

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

### wxRichTextPrinting::SetPreviewRect

void SetPreviewRect(const wxRect& rect)

Sets the dimensions to be used for the preview window.

### wxRichTextPrinting::SetPrintData

void SetPrintData(const wxPrintData& printData)

Sets the print data.

### wxRichTextPrinting::SetShowOnFirstPage

void SetShowOnFirstPage(bool show)

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

### wxRichTextPrinting::SetTitle

void SetTitle(const wxString& title)

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