************************
wx.html.HtmlEasyPrinting
************************
Inheritance diagram for `wx.html.HtmlEasyPrinting`:
|
.. inheritance-diagram:: wx.html.HtmlEasyPrinting
|
Description
===========
This class provides very simple interface to printing architecture. It allows you to print HTML documents using only a few commands.
Derived From
^^^^^^^^^^^^^
* `wx.Object <../Widgets/wx.Object.html>`_
Methods Summary
^^^^^^^^^^^^^^^
* `__init__ <#__init__>`_
* `GetPageSetupData <#GetPageSetupData>`_
* `GetParentWindow <#GetParentWindow>`_
* `GetPrintData <#GetPrintData>`_
* `PageSetup <#PageSetup>`_
* `PreviewFile <#PreviewFile>`_
* `PreviewText <#PreviewText>`_
* `PrintFile <#PrintFile>`_
* `PrintText <#PrintText>`_
* `SetFonts <#SetFonts>`_
* `SetFooter <#SetFooter>`_
* `SetHeader <#SetHeader>`_
* `SetParentWindow <#SetParentWindow>`_
* `SetStandardFonts <#SetStandardFonts>`_
Properties Summary
^^^^^^^^^^^^^^^^^^
* `PageSetupData <#PageSetupData>`_
* `PrintData <#PrintData>`_
Class API
=========
Methods
^^^^^^^
.. method:: __init__(name="Printing", parentWindow=None)
Constructor.
**Parameters:**
* `name` (string): Name of the printing object. Used by preview frames and setup dialogs.
* `parentWindow` (`wx.Window <../Widgets/wx.Window.html>`_): pointer to the window that will own the preview frame and setup dialogs. May be ``None``.
|
**Returns:**
`wx.html.HtmlEasyPrinting `_
--------
.. method:: GetPageSetupData()
Returns a pointer to `wx.PageSetupDialogData <../Widgets/wx.PageSetupDialogData.html>`_ instance used by this class.
You can set its parameters (via `SetXXXX` methods).
|
**Returns:**
`wx.PageSetupDialogData <../Widgets/wx.PageSetupDialogData.html>`_
--------
.. method:: GetParentWindow()
Gets the parent window for dialogs.
|
**Returns:**
`wx.Window <../Widgets/wx.Window.html>`_
--------
.. method:: GetPrintData()
Returns pointer to `wx.PrintData <../Widgets/wx.PrintData.html>`_ instance used by this class.
You can set its parameters (via `SetXXXX` methods).
|
**Returns:**
`wx.PrintData <../Widgets/wx.PrintData.html>`_
--------
.. method:: PageSetup()
Display page setup dialog and allows the user to modify settings.
--------
.. method:: PreviewFile(htmlfile)
Preview HTML file.
Returns ``False`` in case of error -- call `wx.Printer.GetLastError <../Widgets/wx.Printer.html#GetLastError>`_ to get detailed information about the kind of the error.
**Parameters:**
* `htmlfile` (string)
|
**Returns:**
`bool`
--------
.. method:: PreviewText(htmltext, basepath="")
Preview HTML text (not file!).
Returns ``False`` in case of error -- call `wx.Printer.GetLastError <../Widgets/wx.Printer.html#GetLastError>`_ to get detailed information about the kind of the error.
**Parameters:**
* `htmltext` (string): HTML text.
* `basepath` (string): base directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.
|
**Returns:**
`bool`
--------
.. method:: PrintFile(htmlfile)
Print HTML file.
Returns ``False`` in case of error -- call `wx.Printer.GetLastError <../Widgets/wx.Printer.html#GetLastError>`_ to get detailed information about the kind of the error.
**Parameters:**
* `htmlfile` (string)
|
**Returns:**
`bool`
--------
.. method:: PrintText(htmltext, basepath="")
Print HTML text (not file!).
Returns ``False`` in case of error -- call `wx.Printer.GetLastError <../Widgets/wx.Printer.html#GetLastError>`_ to get detailed information about the kind of the error.
**Parameters:**
* `htmltext` (string): HTML text.
* `basepath` (string): base directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.
|
**Returns:**
`bool`
--------
.. method:: SetFonts(normal_face, fixed_face, sizes=None)
Sets fonts. See `wx.html.HtmlWindow.SetFonts `_ for detailed description.
**Parameters:**
* `normal_face` (string)
* `fixed_face` (string)
* `sizes = None` (int)
--------
.. method:: SetFooter(footer, pg=wx.html.PAGE_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` (string): HTML text to be used as footer.
* `pg` (int): one of ``wx.html.PAGE_ODD``, ``wx.html.PAGE_EVEN`` and ``wx.html.PAGE_ALL`` constants.
--------
.. method:: SetHeader(header, pg=wx.html.PAGE_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:**
* `footer` (string): HTML text to be used as header.
* `pg` (int): one of ``wx.html.PAGE_ODD``, ``wx.html.PAGE_EVEN`` and ``wx.html.PAGE_ALL`` constants.
--------
.. method:: SetParentWindow(window)
Sets the parent window for dialogs.
**Parameters:**
* `window` (`wx.Window <../Widgets/wx.Window.html>`_)
--------
.. method:: SetStandardFonts(size=-1, normal_face="", fixed_face="")
|
**Parameters:**
* `size` (int)
* `normal_face` (string)
* `fixed_face` (string)
--------
Properties
^^^^^^^^^^
.. attribute:: PageSetupData
See `GetPageSetupData <#GetPageSetupData>`_
.. attribute:: PrintData
See `GetPrintData <#GetPrintData>`_