How can I print an HTML page

Once the HTML is displayed on the screen, the next logical thing to do is print the HTML. The class for this is wx.html.HtmlEasyPrinting. You create an instance of wx.html.HtmlEasyPrinting with a simple constructor, wx.html.HtmlEasyPrinting(name="Printing", parentWindow=None)

The parameters aren't usually that important—the name parameter is just a string that is used for display in the various dialogs that the easy printing instance creates. If defined, the parentWindow is the parent window of those dialogs. If the parentWindow is None, the dialogs display at the top level. You should only create one instance of wx.html.HtmlEasyPrinting. Although this is not enforced by the wxPython system, the class is designed to be a singleton.

Was this article helpful?

0 0

Post a comment