On Sunday 16 May 2010 10:52:54 am John wrote: > On Sunday 16 May 2010 08:44:31 am Jeff Johnson wrote: > > I was about to ask a similar question. I want to be able to print > > directly to a printer instead of a pdf. Pop up a standard printer > > selection dialog and select a printer and print. I also need to print > > on Avery labels on a label printer. > > > > Can someone point me in the correct direction? > > First there is a wxPython way of printing directly. Check out wx.Printout > class. But I do not use it and can't really comment on it's use. > http://wiki.wxpython.org/Printing > > What I do for windows is: > 1. use ReportDesigner to create a template. > 2. run it to create a pdf document > 3. use ghostscript to print it. > note: I think using Acrobat Reader with '/p' will also print - not tested > > On linux I just print the PDF because Linux supports direct printing of > PDF's. Actually, Linux just uses ghostscript to print too. > > The above will work with Avery Labels too. > > To pop-up a printer dialog on windows I use > import win32print > selectedPrinter=win32print.GetDefaultPrinter() > > on Linux I use cups.py > import cups > c = cups.Connection () > self.printers = c.getPrinters () > > That's way I do it and it works (so far) for me. > > With the above said I have been playing with several report/printing > solutions. As I said earlier on the list openOffice works well. But there > are others - mostly java solutions. If you use jython (it is possible to > call jython code from python) you can program jfreeReport, pentaho, I can't > recall the other java solutions. In general I found them to work very > well. But some of them cost big $ bucks and may present other issues. > > On the python side there is using ReportLap directly and geraldo reports. > I have not used ReportLap directly nor do I use geraldo. Paul made a small > statement about geraldo suggesting he thought is was interesting. > Reviewing the geraldo website it looks like it can do it all. I think it > has an option to print directly. > > IMHO printing in the python is a mess. Dabo has done one of the better > jobs (thanks Paul) in providing a solution. So thoses of us use to using > VFP reports or Crystal reports in a interactive way are just SOL. BTW > Crystal Reports is available on Linux as a server - but I dislike Crystal. > > Johnf
I forgot the wx.PrintDialog. I can't recall but for some reason I decided against using it. But it's there and may serve your needs. Johnf _______________________________________________ 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]
