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