Why no DC for HtmlPrintout

Why can I not get a DC for HtmlPrintout?

       printout = wx.html.HtmlPrintout()
       printout.SetHtmlText("something")
       dc = printout.GetDC()

The dc always ends up being None. HtmlPrintout is derived from wx.Printout so why doesn't this work?

What do I do if I want to "enhance" the html printout by directly drawing to the DC?

Thanks,
Michael

Michael Hipp wrote:

Why can I not get a DC for HtmlPrintout?

      printout = wx.html.HtmlPrintout()
      printout.SetHtmlText("something")
      dc = printout.GetDC()

The dc always ends up being None. HtmlPrintout is derived from wx.Printout so why doesn't this work?

What do I do if I want to "enhance" the html printout by directly drawing to the DC?

I think the DC only exists while the document is being printed, IOW while the OnPrintPage and etc. methods are being called. Before you ask, HtmlPrintout isn't currently instrumented to allow overriding these methods in a derived class in Python...

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!