On Dec 15, 2008, at 11:53 AM, Jeff Johnson wrote:
> I need to be able to print to preprinted forms like packing slips or
> checks. Assuming I have a Dabo app that needs to do this type of
> printing, what approach should I take? Is there a module similar to
> Reportlab that supports printing to a printer? Does the report
> designer
> only work with Reportlab?
Here's the one bit of print code I created. It only applies to the
code editor control (which is based on the wxPython StyledTextControl/
STC), but it shows the basics:
def onPrint(self, evt=None):
pdd = wx.PrintDialogData()
pdd.SetPrintData(self._printData)
printer = wx.Printer(pdd)
printout = STCPrintout(self, stc.STC_PRINT_COLOURONWHITEDEFAULTBG,
self._fileName, False)
if not printer.Print(self.Form, printout):
dabo.errorLog.write(_("An error occured while printing."))
else:
self.printData =
wx.PrintData(printer.GetPrintDialogData().GetPrintData())
printout.Destroy()
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]