.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.html.HtmlPrintout:
==========================================================================================================================================
|phoenix_title| **wx.html.HtmlPrintout**
==========================================================================================================================================
This class serves as printout class for HTML documents.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
HtmlPrintout:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.html.HtmlPrintout.__init__` Constructor.
:meth:`~wx.html.HtmlPrintout.AddFilter` Adds a filter to the static list of filters for :ref:`wx.html.HtmlPrintout`.
:meth:`~wx.html.HtmlPrintout.SetFonts` This function sets font sizes and faces.
:meth:`~wx.html.HtmlPrintout.SetFooter` Set page footer.
:meth:`~wx.html.HtmlPrintout.SetHeader` Set page header.
:meth:`~wx.html.HtmlPrintout.SetHtmlFile` Prepare the class for printing this HTML **file**.
:meth:`~wx.html.HtmlPrintout.SetHtmlText` Prepare the class for printing this HTML text.
:meth:`~wx.html.HtmlPrintout.SetMargins` Sets margins in millimeters.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.html.HtmlPrintout(Printout)
**Possible constructors**::
HtmlPrintout(title: str="Printout") -> None
This class serves as printout class for HTML documents.
.. method:: __init__(self, title: str="Printout")
Constructor.
:param `title`:
:type `title`: string
:rtype: `None`
.. staticmethod:: AddFilter(filter : HtmlFilter)
Adds a filter to the static list of filters for :ref:`wx.html.HtmlPrintout`.
See :ref:`wx.html.HtmlFilter` for further information.
:param `filter`:
:type `filter`: wx.html.HtmlFilter
:rtype: `None`
.. method:: SetFonts(self, normal_face : str, fixed_face : str, sizes : List[int])
This function sets font sizes and faces.
See :meth:`wx.html.HtmlWindow.SetFonts` for detailed description.
:param `normal_face`:
:type `normal_face`: string
:param `fixed_face`:
:type `fixed_face`: string
:param `sizes`:
:type `sizes`: list of integers
:rtype: `None`
.. method:: SetFooter(self, footer : str, pg: int=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
:param `footer`: HTML text to be used as footer.
:type `footer`: string
:param `pg`: one of ``wx.html.PAGE_ODD``, ``wx.html.PAGE_EVEN`` and ``wx.html.PAGE_ALL`` constants.
:type `pg`: int
:rtype: `None`
.. method:: SetHeader(self, header : str, pg: int=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
:param `header`: HTML text to be used as header.
:type `header`: string
:param `pg`: one of ``wx.html.PAGE_ODD``, ``wx.html.PAGE_EVEN`` and ``wx.html.PAGE_ALL`` constants.
:type `pg`: int
:rtype: `None`
.. method:: SetHtmlFile(self, htmlfile : str)
Prepare the class for printing this HTML **file**.
The file may be located on any virtual file system or it may be normal file.
:param `htmlfile`:
:type `htmlfile`: string
:rtype: `None`
.. method:: SetHtmlText(self, html : str, basepath: str='', isdir: bool=True)
Prepare the class for printing this HTML text.
:param `html`: HTML text. (NOT file!)
:type `html`: string
:param `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.
:type `basepath`: string
:param `isdir`: ``False`` if basepath is filename, ``True`` if it is directory name (see :ref:`wx.FileSystem` for detailed explanation).
:type `isdir`: bool
:rtype: `None`
.. method:: SetMargins(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**SetMargins** `(self, top: float=25.2, bottom: float=25.2, left: float=25.2, right: float=25.2, spaces: float=5)`
Sets margins in millimeters.
Defaults to 1 inch for margins and 0.5cm for space between text and header and/or footer.
:param `top`:
:type `top`: float
:param `bottom`:
:type `bottom`: float
:param `left`:
:type `left`: float
:param `right`:
:type `right`: float
:param `spaces`:
:type `spaces`: float
:rtype: `None`
:html:`
`
**SetMargins** `(self, pageSetupData : PageSetupDialogData)`
Sets margins from :ref:`wx.PageSetupDialogData`.
:param `pageSetupData`:
:type `pageSetupData`: wx.PageSetupDialogData
:rtype: `None`
.. versionadded:: 4.1/wxWidgets-3.1.0
:html:`
`