This class provides very simple interface to printing architecture. It allows you to print HTML documents using only a few commands.
Note
Do not create this class on the stack only. You should create an instance on app startup and use this instance for all printing operations. The reason is that this class stores various settings in it.
Derived from
Include files
<wx/html/htmprint.h>
Members
wxHtmlEasyPrinting::wxHtmlEasyPrinting
wxHtmlEasyPrinting::PreviewFile
wxHtmlEasyPrinting::PreviewText
wxHtmlEasyPrinting::PrintFile
wxHtmlEasyPrinting::PrintText
wxHtmlEasyPrinting::PrinterSetup
wxHtmlEasyPrinting::PageSetup
wxHtmlEasyPrinting::SetFonts
wxHtmlEasyPrinting::SetHeader
wxHtmlEasyPrinting::SetFooter
wxHtmlEasyPrinting::GetPrintData
wxHtmlEasyPrinting::GetPageSetupData
wxHtmlEasyPrinting(const wxString& name = "Printing", wxWindow* parentWindow = NULL)
Constructor.
Parameters
name
parentWindow
bool PreviewFile(const wxString& htmlfile)
Preview HTML file.
Returns false in case of error -- call wxPrinter::GetLastError to get detailed information about the kind of the error.
bool PreviewText(const wxString& htmltext, const wxString& basepath = wxEmptyString)
Preview HTML text (not file!).
Returns false in case of error -- call wxPrinter::GetLastError to get detailed information about the kind of the error.
Parameters
htmltext
basepath
bool PrintFile(const wxString& htmlfile)
Print HTML file.
Returns false in case of error -- call wxPrinter::GetLastError to get detailed information about the kind of the error.
bool PrintText(const wxString& htmltext, const wxString& basepath = wxEmptyString)
Print HTML text (not file!).
Returns false in case of error -- call wxPrinter::GetLastError to get detailed information about the kind of the error.
Parameters
htmltext
basepath
void PrinterSetup()
Display printer setup dialog and allows the user to modify settings.
void PageSetup()
Display page setup dialog and allows the user to modify settings.
void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL)
Sets fonts. See wxHtmlWindow::SetFonts for detailed description.
void SetHeader(const wxString& header, int pg = wxPAGE_ALL)
Set page header.
Parameters
header
pg
void SetFooter(const wxString& footer, int pg = wxPAGE_ALL)
Set page footer.
Parameters
footer
pg
wxPrintData* GetPrintData()
Returns pointer to wxPrintData instance used by this class. You can set its parameters (via SetXXXX methods).
wxPageSetupDialogData* GetPageSetupData()
Returns a pointer to wxPageSetupDialogData instance used by this class. You can set its parameters (via SetXXXX methods).