wx.html.HtmlEasyPrinting
Inheritance diagram for 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.
Class API
Methods
-
__init__(name="Printing", parentWindow=None)
Constructor.
Parameters:
- name (string): Name of the printing object. Used by preview frames and setup dialogs.
- parentWindow (wx.Window): pointer to the window that will own the preview frame and setup dialogs. May be None.
Returns:
wx.html.HtmlEasyPrinting
-
GetPageSetupData()
Returns a pointer to wx.PageSetupDialogData instance used by this class.
You can set its parameters (via SetXXXX methods).
Returns:
wx.PageSetupDialogData
-
GetParentWindow()
Gets the parent window for dialogs.
Returns:
wx.Window
-
GetPrintData()
Returns pointer to wx.PrintData instance used by this class.
You can set its parameters (via SetXXXX methods).
Returns:
wx.PrintData
-
PageSetup()
- Display page setup dialog and allows the user to modify settings.
-
PreviewFile(htmlfile)
Preview HTML file.
Returns False in case of error – call wx.Printer.GetLastError to get detailed information about the kind of the error.
Parameters:
Returns:
bool
-
PreviewText(htmltext, basepath="")
Preview HTML text (not file!).
Returns False in case of error – call wx.Printer.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
-
PrintFile(htmlfile)
Print HTML file.
Returns False in case of error – call wx.Printer.GetLastError to get detailed information about the kind of the error.
Parameters:
Returns:
bool
-
PrintText(htmltext, basepath="")
Print HTML text (not file!).
Returns False in case of error – call wx.Printer.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
-
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)
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.
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.
-
SetParentWindow(window)
Sets the parent window for dialogs.
Parameters:
-
SetStandardFonts(size=-1, normal_face="", fixed_face="")
-
Parameters:
- size (int)
- normal_face (string)
- fixed_face (string)