wx.html.HtmlEasyPrinting¶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.
Methods Summary¶__init__ |
Constructor. |
GetName |
Returns the current name being used for preview frames and setup dialogs. |
GetPageSetupData |
Returns a pointer to wx.PageSetupDialogData instance used by this class. |
GetParentWindow |
Gets the parent window for dialogs. |
GetPrintData |
Returns pointer to wx.PrintData instance used by this class. |
PageSetup |
Display page setup dialog and allows the user to modify settings. |
PreviewFile |
Preview HTML file. |
PreviewText |
Preview HTML text (not file!). |
PrintFile |
Print HTML file. |
PrintText |
Print HTML text (not file!). |
SetFonts |
Sets fonts. |
SetFooter |
Set page footer. |
SetHeader |
Set page header. |
SetName |
Sets the name used for preview frames and setup dialogs. |
SetParentWindow |
Sets the parent window for dialogs. |
SetStandardFonts |
Sets default font sizes and/or default font size. |
Properties Summary¶Name |
See GetName and SetName |
PageSetupData |
See GetPageSetupData |
ParentWindow |
See GetParentWindow and SetParentWindow |
PrintData |
See GetPrintData |
Class API¶wx.html.HtmlEasyPrinting(Object)¶Possible constructors:
HtmlEasyPrinting(name="Printing", parentWindow=None)
This class provides very simple interface to printing architecture.
__init__(self, name="Printing", parentWindow=None)¶Constructor.
| Parameters: |
|
|---|
GetName(self)¶Returns the current name being used for preview frames and setup dialogs.
| Return type: | string |
|---|
New in version 2.8.11: / 2.9.1
GetPageSetupData(self)¶Returns a pointer to wx.PageSetupDialogData instance used by this class.
You can set its parameters (via SetXXXX methods).
| Return type: | PageSetupDialogData |
|---|
GetParentWindow(self)¶Gets the parent window for dialogs.
| Return type: | Window |
|---|
GetPrintData(self)¶Returns pointer to wx.PrintData instance used by this class.
You can set its parameters (via SetXXXX methods).
| Return type: | PrintData |
|---|
PageSetup(self)¶Display page setup dialog and allows the user to modify settings.
PreviewFile(self, htmlfile)¶Preview HTML file.
Returns False in case of error wx.Printer.GetLastError to get detailed information about the kind of the error.
| Parameters: | htmlfile (string) – |
|---|---|
| Return type: | bool |
PreviewText(self, htmltext, basepath="")¶Preview HTML text (not file!).
Returns False in case of error wx.Printer.GetLastError to get detailed information about the kind of the error.
| Parameters: |
|
|---|---|
| Return type: | bool |
PrintFile(self, htmlfile)¶Print HTML file.
Returns False in case of error wx.Printer.GetLastError to get detailed information about the kind of the error.
| Parameters: | htmlfile (string) – |
|---|---|
| Return type: | bool |
PrintText(self, htmltext, basepath="")¶Print HTML text (not file!).
Returns False in case of error wx.Printer.GetLastError to get detailed information about the kind of the error.
| Parameters: |
|
|---|---|
| Return type: | bool |
SetFonts(self, normal_face, fixed_face, sizes)¶Sets fonts.
See wx.html.HtmlDCRenderer.SetFonts for detailed description.
| Parameters: |
|
|---|
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: |
|
|---|
SetHeader(self, header, pg=PAGE_ALL)¶Set page header.
The following macros can be used inside it:
| Parameters: |
|
|---|
SetName(self, name)¶Sets the name used for preview frames and setup dialogs.
| Parameters: | name (string) – |
|---|
New in version 2.8.11: / 2.9.1
SetStandardFonts(self, size=-1, normal_face="", fixed_face="")¶Sets default font sizes and/or default font size.
See wx.html.HtmlDCRenderer.SetStandardFonts for detailed description.
| Parameters: |
|
|---|
See also
PageSetupData¶See GetPageSetupData
ParentWindow¶See GetParentWindow and SetParentWindow
PrintData¶See GetPrintData