I am struggling with printing from wxpython. Please dont refer me to the wxpython wiki - been there done that.
I have two almost identical snippets of code to perform a print preview and a paper print of a wxmpl figure. The print preview works brilliantly, print to paper - nothing happens on the paper. A 0 byte print job flashes through the windows print spooler and that's it.
For text reports I got easy html printing going - that was indeed easy.... but I fought and fought with wxPrintout and gave up.... I had exactly the same problem - print preview worked fine - but print paper - empty print jobs.. I am missing something - but I dont know what. Please not the wiki - it's not helping me - it normally is fantastic.
Can anyone post some code that will print a wxmpl figure? Here's mine - it's in a state after several days of failed attempts....
self.printer_config = wx.PrintData()
print "Printer is: ", self.printer_config.GetPrinterName() # no printer name is reported here -
# yet a print job is sent to the pritner
self.printer_config.SetPaperId(wx.PAPER_A4_ROTATED) tim = wxmpl.FigurePrinter(self,self.printer_config)
tim.printFigure(self.ProdGraph.get_figure(), "Production Schedule")
Plan B - my customer wants the graph on paper - he doesnt care how I do it - and right now neither do I
I have wxmpl making a png image in a file - can some one give me the minimum lines of code - to get the png on paper - please. Lets say the file is called graph.png.
RedHat Certified Engineer
TBITC Pty Ltd
Professional Computer Support for Business
Mobile 0422 942 972
Office 85 662 016