| Version: 3.0.2

- Main Page
- Related Pages
- Categories
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
wxHtmlEasyPrinting Class Reference
HTML | Printing Framework

`#include <wx/html/htmprint.h>`

Inheritance diagram for wxHtmlEasyPrinting:
[legend]

## Detailed Description

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.

##

Library: wxHTML
Category: HTML, Printing Framework

## Public Member Functions
| wxHtmlEasyPrinting (const wxString &name="Printing", wxWindow *parentWindow=NULL)
| Constructor.
const wxString & | GetName () const
| Returns the current name being used for preview frames and setup dialogs.
wxPageSetupDialogData * | GetPageSetupData ()
| Returns a pointer to wxPageSetupDialogData instance used by this class.
wxWindow * | GetParentWindow () const
| Gets the parent window for dialogs.
wxPrintData * | GetPrintData ()
| Returns pointer to wxPrintData instance used by this class.
void | PageSetup ()
| Display page setup dialog and allows the user to modify settings.
bool | PreviewFile (const wxString &htmlfile)
| Preview HTML file.
bool | PreviewText (const wxString &htmltext, const wxString &basepath=wxEmptyString)
| Preview HTML text (not file!).
bool | PrintFile (const wxString &htmlfile)
| Print HTML file.
bool | PrintText (const wxString &htmltext, const wxString &basepath=wxEmptyString)
| Print HTML text (not file!).
void | SetFonts (const wxString &normal_face, const wxString &fixed_face, const int *sizes=NULL)
| Sets fonts.
void | SetName (const wxString &name)
| Sets the name used for preview frames and setup dialogs.
void | SetStandardFonts (int size=-1, const wxString &normal_face=wxEmptyString, const wxString &fixed_face=wxEmptyString)
| Sets default font sizes and/or default font size.
void | SetFooter (const wxString &footer, int pg=wxPAGE_ALL)
| Set page footer.
void | SetHeader (const wxString &header, int pg=wxPAGE_ALL)
| Set page header.
void | SetParentWindow (wxWindow *window)
| Sets the parent window for dialogs.
Public Member Functions inherited from wxObject
| wxObject ()
| Default ctor; initializes to NULL the internal reference data.
| wxObject (const wxObject &other)
| Copy ctor.
virtual | ~wxObject ()
| Destructor.
virtual wxClassInfo * | GetClassInfo () const
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar).
wxObjectRefData * | GetRefData () const
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
bool | IsKindOf (const wxClassInfo *info) const
| Determines whether this class is a subclass of (or the same class as) the given class.
bool | IsSameAs (const wxObject &obj) const
| Returns true if this object has the same data pointer as obj.
void | Ref (const wxObject &clone)
| Makes this object refer to the data in clone.
void | SetRefData (wxObjectRefData *data)
| Sets the wxObject::m_refData pointer.
void | UnRef ()
| Decrements the reference count in the associated data, and if it is zero, deletes the data.
void | UnShare ()
| This is the same of AllocExclusive() but this method is public.
void | operator delete (void *buf)
| The delete operator is defined for debugging versions of the library only, when the identifier `WXDEBUG` is defined.
void * | operator new (size_t size, const wxString &filename=NULL, int lineNum=0)
| The new operator is defined for debugging versions of the library only, when the identifier `WXDEBUG` is defined.

## Additional Inherited Members
Protected Member Functions inherited from wxObject
void | AllocExclusive ()
| Ensure that this object's data is not shared with any other object.
virtual wxObjectRefData * | CreateRefData () const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it.
virtual wxObjectRefData * | CloneRefData (const wxObjectRefData *data) const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data.
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data.

## Constructor & Destructor Documentation

wxHtmlEasyPrinting::wxHtmlEasyPrinting | ( | const wxString & | name = `"Printing"`,
|  | wxWindow * | parentWindow = `NULL`
| ) |  |

Constructor.

Parameters

  name | Name of the printing object. Used by preview frames and setup dialogs.
  parentWindow | pointer to the window that will own the preview frame and setup dialogs. May be NULL.

## Member Function Documentation

const wxString& wxHtmlEasyPrinting::GetName | ( |  | ) | const

Returns the current name being used for preview frames and setup dialogs.

Since
  2.8.11 / 2.9.1

wxPageSetupDialogData* wxHtmlEasyPrinting::GetPageSetupData | ( |  | ) |

Returns a pointer to wxPageSetupDialogData instance used by this class.

You can set its parameters (via SetXXXX methods).

wxWindow* wxHtmlEasyPrinting::GetParentWindow | ( |  | ) | const

Gets the parent window for dialogs.

wxPrintData* wxHtmlEasyPrinting::GetPrintData | ( |  | ) |

Returns pointer to wxPrintData instance used by this class.

You can set its parameters (via SetXXXX methods).

void wxHtmlEasyPrinting::PageSetup | ( |  | ) |

Display page setup dialog and allows the user to modify settings.

bool wxHtmlEasyPrinting::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 wxHtmlEasyPrinting::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 | HTML text.
  basepath | base directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.

bool wxHtmlEasyPrinting::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 wxHtmlEasyPrinting::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 | HTML text.
  basepath | base directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.

void wxHtmlEasyPrinting::SetFonts | ( | const wxString & | normal_face,
|  | const wxString & | fixed_face,
|  | const int * | sizes = `NULL`
| ) |  |

Sets fonts.

See wxHtmlDCRenderer::SetFonts for detailed description.

void wxHtmlEasyPrinting::SetFooter | ( | const wxString & | footer,
|  | int | pg = `wxPAGE_ALL`
| ) |  |

Set page footer.

The following macros can be used inside it: @DATE@ is replaced by the current date in default format @PAGENUM@ is replaced by page number @PAGESCNT@ is replaced by total number of pages @TIME@ is replaced by the current time in default format @TITLE@ is replaced with the title of the document

Parameters

  footer | HTML text to be used as footer.
  pg | one of wxPAGE_ODD, wxPAGE_EVEN and wxPAGE_ALL constants.

void wxHtmlEasyPrinting::SetHeader | ( | const wxString & | header,
|  | int | pg = `wxPAGE_ALL`
| ) |  |

Set page header.

The following macros can be used inside it:

- @DATE@ is replaced by the current date in default format
- @PAGENUM@ is replaced by page number
- @PAGESCNT@ is replaced by total number of pages
- @TIME@ is replaced by the current time in default format
- @TITLE@ is replaced with the title of the document

Parameters

  header | HTML text to be used as header.
  pg | one of wxPAGE_ODD, wxPAGE_EVEN and wxPAGE_ALL constants.

void wxHtmlEasyPrinting::SetName | ( | const wxString & | name | ) |

Sets the name used for preview frames and setup dialogs.

Since
  2.8.11 / 2.9.1

void wxHtmlEasyPrinting::SetParentWindow | ( | wxWindow * | window | ) |

Sets the parent window for dialogs.

void wxHtmlEasyPrinting::SetStandardFonts | ( | int | size = `-1`,
|  | const wxString & | normal_face = `wxEmptyString`,
|  | const wxString & | fixed_face = `wxEmptyString`
| ) |  |

Sets default font sizes and/or default font size.

See wxHtmlDCRenderer::SetStandardFonts for detailed description.

See Also
  SetFonts()